Day 9: Deep Dive in Git & GitHub

What is Git and why is it important?
Git is a distributed version control system that helps us to track the changes of a particular file. It helps the team to collaborate for a speedy development cycle.
What is the difference Between the Main Branch and the Master Branch?
Master Branch: This is the first branch that gets created at the time of creating the repository. It is used to store the latest working code. Also, known as the default branch.
Main Branch: We can state that there is no difference between the Main and Master branches. The master branch is the default branch in the git repository. However, the master branch is no longer used by GitHub by default; instead, the main is used i.e. Master is renamed as main. As for others, their default branch is still the master branch. 🌿
Can you explain the difference between Git and GitHub?
Git is a distributed version control system that lets you work with other developers and keep track of changes made to your code.
GitHub is a cloud-based platform that supports Git repositories and offers several functionalities, including project management, code review, issue tracking, and more.
How do you create a new repository on GitHub?
1. Log in to github.com
2. Go to the repository tab and click on the New button to create a new repository.


Congratulations!!! Your repository has been created.
What is the difference between local & remote repositories? How to connect local to remote?
Local branch
A local branch is a branch that you create and work with on your computer. It is not shared with anyone else. You can use local branches to experiment with new ideas, test changes, or fix bugs without affecting the main codebase.
Remote branch
A remote branch is a branch that exists on a remote server, such as GitHub or Bitbucket. You can push your local branch to a remote server to share your changes with others. You can also pull changes from a remote branch to your local machine to get the latest updates.
With the help of the below command, we can connect the local branch to the remote branch:
git remote add origin <github repo URL>
Tasks for today:
Task-1:
Set your user name and email address, which will be associated with your commits

Task-2:
Create a repository named "Devops" on GitHu


Connect your local repository to the repository on GitHub

Create a new file in Devops/Git/Day-02.txt & add some content to it

Push your local commits to the repository on GitHub


With this our today's tasks get completed. Please feel free to drop any comment for any queries & feedback.
Happy Learning!!




