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

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

What is Git and why is it important?

Git - It is a free open-source free version control system that will handle the project with speed and efficiency. It is also used for code management and to track changes in source code which allow multiple developers to work together and contribute. With git, you can keep a record of who made changes to what part of the file, so this can be reverted back to an earlier version of the file.

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

No difference between the Main and Master Branch in git, the Master branch is a default branch used to create a repository.

Can you explain the difference between Git and GitHub?

Git is a free open-source software that is maintained by Linux. You can install it on the local system. It is a Version control system to manage and track changes locally. Git mainly focuses on Version control and code management.

GitHub is a service that is maintained by Microsoft. It is a graphical user interface that is hosted on the web. Git hub focuses on centralizing the code. It is a service we use to store our project files.

How do you create a new repository on GitHub?

To create a new repository on Github:

  1. Go to github.com and log in to your account.

  2. On the upper right corner, click the + and select the new repository.

    1. Enter the name of the repository.

    2. Choose whether you wanted the repository to be public or private.

    3. Add README file

    4. Click Create the Repository.

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

        The local repository is on our local computer. Git local repository is the one on which we will make local changes.

        A git remote repository is hosted on the server and it will be accessible to everyone.

      2. A git remote command is used to make a remote connection i.e connecting to Git local repository and Github remote repository.

git remote add origin github.com/your-username/your repository

git push origin master

Task 1 :

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

Task-2:

  1. Create a repository named "Devops" on GitHub

  2. Connect your local repository to the repository on GitHub.

    git init the command makes the present directory to the git repository.

    git remote the command connects the local repository to the local repository.

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

  4. Push your local commits to the repository on GitHub

    git push: It uploads local repository content to a remote repository.

    Thank you for reading this blog!

Happy Learning!