Day8-90Days of DevOps Challenge /GIT & GitHub for DevOps
What is Git?
Git is a distributed version control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows.
For example, you could be working on a website's landing page and discover that you do not like the navigation bar. But at the same time, you might not want to start altering its components because it might get worse.
With Git, you can create an identical copy of that file and play around with the navigation bar. Then, when you are satisfied with your changes, you can merge the copy to the original file.
What is GitHub?
GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its features.
GitHub lets you store your repo on their platform. Another awesome feature that comes with GitHub is the ability to collaborate with other developers from any location.
What is Version Control? How many types of version controls do we have?
Version Control Systems are process management systems that maintain changes recorded in a file or set of files over a period of time. Each change is maintained as a version. Users can track specific versions later. Version control systems do not require any other repository systems and can be cloned as per the need and availability. This is extremely helpful in case of failure and accidental deletions.
There are two main types of version control systems:
Centralized version control systems:
Centralized version control systems contain just one repository globally and every user needs to commit to reflecting one’s changes in the repository. It is possible for others to see your changes by updating.
Two things are required to make your changes visible to others which are:
Distributed Version Control Systems:
Distributed version control systems contain multiple repositories. Each user has their own repository and working copy. Just committing your changes will not give others access to your changes. This is because commit will reflect those changes in your local repository and you need to push them in order to make them visible on the central repository. Similarly, When you update, you do not get others’ changes unless you have first pulled those changes into your repository.
To make your changes visible to others, 4 things are required:
Why should we choose distributed over central version control?
Overall, the decentralized nature of a DVCS allows for greater collaboration, flexibility, and security, making it a popular choice for many teams.
Task1:Install GIT
sudo apt-get update
sudo apt-get install git
领英推荐
Create a GitHub Account:
By following these steps on your Linux system, you'll have Git installed, and a GitHub account created.
Exercise 1: Create a New Repository on GitHub
Exercise 2: Clone the Repository to Your Local Machine
On the repository page, click the green "Code" button.
git clone <paste_the_copied_url>
Press Enter to execute the command.
Exercise 3: Make Changes, Commit, and Push
Now that you have the repository cloned locally, you can make changes to the files and commit them to track the modifications. Follow these steps: