Deep Dive in Git & GitHub for DevOps Engineers :
Nihal Apretwar
DevOps?? || Cloud?? || Linux??|| Docker?? || Git?? || Kubernetes?? || Terraform??? || AWS?? || Monitoring???
What is Git and why is it important?
Git is a version control system. It maintains a history of all changes made to the code. The changes are stored in a special database called “repository”, also known as “repo”.
it is important because of Tracking the changes and updates. We can see who made which changes. Git also provides when and why a change was made.
Allowing them to work collaboratively. Software development projects usually require many people to work together. Git provides developers with a systematic way of doing that. Thus, the developers focus on the project instead of extensive communication sessions between the other developers.
What is difference Between Main Branch and Master Branch?
Main?or?master?is the default branch when you create a repository. GitHub now uses main as its default branch while others still use master.
Earlier, Microsoft GitHub also has mastered as their default branch, but some peoples at Microsoft think that the?master?name is kind of similar to slavery, which is offensive according to Microsoft. Hence they changed its name to?main.
Can you explain the difference between Git and GitHub?
How do you create a new repository on GitHub?
Go to the GitHub websiteand log in to your account.
In the top-right corner of the screen, click the plus (+) button and select "New repository" from the drop-down menu.
On the next page, enter a name for your repository, a short description (optional), and select whether you want the repository to be public or private. Public repositories are visible to anyone, while private repositories can only be accessed by you and the people you invite.
You also have an option of initializing the repository with a README file or add a git ignore and a license.
Once you're done, click the "Create repository" button.
The new repository will be created and you will be taken to the repository's main page, where you can see the files in the repository and manage the repository's settings.
What is difference between local & remote repository? How to connect local to remote?
A local repository is a version of a project that is stored on your own machine, while a remote repository is a version of a project that is stored on a separate machine or server, such as on a hosting service like GitHub or GitLab.
One of the main differences between a local and remote repository is that a local repository is only accessible to you on your own machine, while a remote repository is typically accessible to multiple people over the internet. This makes it easy for multiple developers to collaborate on the same codebase, even if they are working from different locations.
领英推荐
Another difference is that a local repository typically stores the entire history of the project, including all of its commits and branches, while a remote repository may only store the most recent version of the project.
To connect a local repository to a remote repository, you need to do the following:
Tasks :
Task 1 :
Task 2 :