Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.

What is Git and why is it important?

Earlier when Linus Torvalds developed Linux, many people were contributing and involved in this open-source project not only in the form of Codes but also ideas and comments. Everyone was making small or large contributions.

After some time, it became really hard to manage and maintain all the changes and updates. That is the reason why Git was created.

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”.

Git is important because it tracks the changes and updates which is necessary while working on software development projects.

\====================

What is the difference Between Main Branch and Master Branch??

There is not much difference between the main and master branch now.

Git and GitHub use the term master for the default version of a source code repository. Its a protected branch. And not anybody can push into that branch.

Developers fork a version of the master to create secondary versions, add their code to this default version, and then merge their changes back into the master.

But wait! Things have changed now:

As of October 1, 2020, “all new Git repositories on GitHub will be named ‘main’ instead of ‘master’.”

Once you choose the ‘Add a README file’ option when you create a new repository, you will be able to see the system notify us that the default branch will be set as main.

So Earlier, the name of the default branch of any repository was “master”. But from October-2020 onward, the default branch of any GitHub repository is using “main” as the default branch name, instead of master.

Main/Master branch is like the main line which shows what all things have been added. Its like a root and then after all other branches have been added to this

Can you explain the difference between Git and GitHub?

Git is a software or tool which is used for version control.

GitHub is a platform or a service, which uses git in the background

How do you create a new repository on GitHub?

Create a new repository on GitHub by clicking on the "New" button on the GitHub homepage and filling out the repository details, such as the name, and description.

Once the repository is created, copy the repository URL by clicking on the "Code" button and selecting the HTTPS or SSH URL.

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

A local repository is a copy of a project that resides on your local machine, while a remote repository is a copy of the same project that resides on a remote server, such as GitHub.

To connect local to remote, Copy the URL of the remote repository to your local using git remote add origin <HTTPS URL>

Verify that the remote was added successfully by running the git remote -v command.

Push your local repository to the remote using the git push -u origin main command. That's all!

\===========================***==============================

Will appreciate your feedback :) #90daysofdevops

linkedin.com/in/sweety-samya-963859130

Happy learning!-