Deep Dive in Git & GitHub for DevOps Engineers.💻

1.What is difference Between Main Branch and Master Branch??

Actually, there is no difference between main and master in Git. ‘Master’ is just the name of the default branch for all the existing repositories. Whereas,if you create a new repository, you will use ‘main’ as the default branch.

2.Can you explain the difference between Git and GitHub?

Git A source tool that helps in tracking and managing codes. It was designed to assist programmers working in coordination and tracking changes in any of the files associated with the local directory.

GitHub is designed as a repository hosting service. It also gives a wide range of features such as collaborating on the project, resolving issues, source code management, and exchanging ideas with people around the world

3. How do you create a new repository on GitHub?

In the upper-right corner of any page, use the + drop-down menu, and select New repository. Create a repository and give a proper name to it. Optionally, add a description of your repository. Select Initialize this repository with a README. Click Create repository.

For detail explanation check out my previous blog

4. What is the difference between local & remote repositories? How to connect local to remote?

Git local repository is the one on which we will make local changes, typically this local repository is on our computer.

Git remote repository is one of the servers, typically a machine situated 42 miles away accessible for all team members

Task-

1:Set your user name and email address, which will be associated with your commits.

To set a username & email:

# git config — global user.name “<name>”

# git config — global user.name “<email id>”

To check the details :

# git config — global user.name

# git config — global user.name

2.Create a repository named “DevOps” on GitHub

  • Connect your local repository to the repository on GitHub.

To connect your local repo to repo on GitHub :

1)git init : The git init command creates a new Git repository

2)git status : New file is added which still untracked

3)git add . : will add all the files

4)git status : Changes need to be committed

5)git commit -m <”adding new file”>

To push changes

1)git remote add origin “Url of Repo created in Github”

2) git push origin master

Thank you for reading! Hope you find value from this article please do follow and click the clap 👏 button below to show your support 😄.

-Thanks for reading🙏🤗☺️

-Shrikar