#Day8:- 90 Days DevOps Challenge @Basic Git & GitHub for DevOps Engineers.

#Day8:- 90 Days DevOps Challenge @Basic Git & GitHub for DevOps Engineers.

Building DevOps Agility: A Comprehensive Git & GitHub Challenge

🧠Introduction

📚Welcome to the Basic Git & GitHub Challenge for Senior DevOps Engineers! Git is like a time machine for your code, helping you track changes and collaborate effectively. GitHub is your magic place on the internet for storing code, working with others, and showcasing projects. In this 90-day challenge, we'll start with the basics and progress to advanced concepts, making Git & GitHub mastery a breeze.

📚What is Git?😕

💥Git is a version control system that allows you to track changes to files and coordinate work on those files among multiple people. It is commonly used for software development, but it can be used to track changes to any set of files.

With Git, you can keep a record of who made changes to what part of a file, and you can revert back to earlier versions of the file if needed. Git also makes it easy to collaborate with others, as you can share changes and merge the changes made by different people into a single version of a file🗃️.

📚What is Github?🎗️

GitHub 🐙 is a web-based platform that provides hosting for version control using Git. where developers can store and manage their code effortlessly! 🌟 As a subsidiary of Microsoft, GitHub offers all the distributed version control and source code management (SCM) functionality of Git, combining it with its own awesome features. 🔄💻 It's no wonder why GitHub is the go-to choice for countless developers to share and collaborate on projects. 🤝 From open-source masterpieces to private repositories, GitHub caters to all your coding needs with a user-friendly interface. 🌈

🥏Why we use distributed version control over centralized version control?

  1. 🎓Better collaboration: In a DVCS, every 👨‍💻developer has a full copy of the repository, including the entire history of all changes. This makes it easier for developers to work together, as they don't have to constantly communicate with a central server to commit their changes or to see the changes made by others.

  2. 🚄Improved speed: Because 👨‍💻developers have a local copy of the repository, they can commit their changes and perform other version control actions faster, as they don't have to communicate with a central server.

  3. ⚜️Greater flexibility: With a DVCS, 👨‍💻developers can work offline and commit their changes later when they do have an internet connection. They can also choose to share their changes with only a subset of the team, rather than pushing all of their changes to a central server.

  4. 📲Enhanced security: In a DVCS, the repository history is stored on multiple servers and computers, which makes it more resistant to data loss. If the central server in a CVCS goes down or the repository becomes corrupted, it can be difficult to recover the lost data.

Overall, the decentralized nature of a DVCS allows for greater collaboration, flexibility, and security, making it a popular choice for many teams.

🥏Let's now perform a practical task based on the theory above.

Create a new repository on GitHub and clone it to your local machine:

:-Go to your github account (If you dont have github account then, You can sign up at https://github.com/

:- Click On New (Right side green button) and create a new repository , Please refer to the below image:

:- Now enter your repository details to create a repository.

😃Now your repository is created successfully🎗️.

Click On upper left side on your repository to see your all repositories.

🚀 In the next step, we will clone this repository into our local machine. 🖥️💻

:- Open Your Git ( if git not installed in your pc then, You can download it from the official website at https://git-scm.com/downloads).

Now go to your github and click on your repository and copy git repository url.

In the next step you are ready to clone your github repo into your local machine.

🏃‍♂️Run the following command:-
git clone <your repository url>

📝NOTE:- Please put your repository address in place of "your repository url".

👨‍💻Now you can check the above image i have executed the git clone command and the respective repository copied into my local machine (In my case repo name is :- devops90days).

Ⓜ️Make some changes to a file in local and commit them to the repository using Git.

:- Currently, our repository is empty. Please go to your local machine and make 1-2 changes by creating files in the respective directory.

:- Now type the below commands,

  • Stage the Changes: Use the git add . command to stage the changes you want to commit. For example, if you modified a file called "example.txt".

Commit the Changes: Committing records the changes you made to the file in the Git history. Use the git commit -m "Your commit message"command with a commit message describing the changes.

Push Changes to the Repository : If you cloned a remote repository and want to update the remote repository with your changes, you'll need to use the git push -u origin main (here, main is your branch name)command.

NOTE:- during the push command, it prompts for the password so login via the same GitHub credential.

🥏Pull the changes back to the local machine from repository on GitHub.

Pull Command : you can use the git pull origin -v main command, which is a combination of git fetch and git merge. This command fetches the remote changes and automatically merges them into your current branch.

We can also use separately git fetch and then git merge origin/main.

💥💥💥💥💥💥Bonus for all the readers, Now they can access Git Cheat Sheet by:- https://education.github.com/git-cheat-sheet-education.pdf

🥨Conclusion

Git and GitHub are like superheroes for DevOps engineers, making teamwork, code control, and development a breeze! Throughout this 90-Day Basic Git & GitHub Challenge, we've learned the art of branches, merging, and pull requests, giving us the power to work together seamlessly. With GitHub as our trusty sidekick, we've shown off our skills, collaborating on open-source projects and building a cool community of developers. As Senior DevOps Engineers, we've become pros at handling changes, experimenting without fear, and keeping a clear record of our progress. Remember, practice makes perfect! Keep learning and growing, and together, we'll conquer the software world. 🚀👩‍💻👨‍💻🌟

Feel free to reach out if you have any questions or need further assistance🚀 by following me on Hashnode, LinkedIn (linkedin.com/in/mahesh-verma-441178250), and GitHub (https://github.com/maheshverma123)