Skip to main content

Command Palette

Search for a command to run...

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

Published
3 min readView as Markdown
Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.

1) What is Git and why is it important?

Git is a free and open source distributed code management and Version control system. Git allows developers to collaborate on projects by making it easy to merge changes made by multiple contributors. It also provides features such as branching and tagging, which make it easy to experiment with different versions of a project and track specific milestones.

2) What is difference Between Main Branch and Master Branch?

The main branch — the one where all changes eventually get merged back into, and is called master.

In essence, "main" and "master" branches are identical in functionality and usage. They both represent the primary branch of a Git repository where the latest changes are merged and from where new branches are typically created. The only difference is the name used for the primary branch.

In practical terms, the difference between the "main" and "master" branch is largely a matter of convention and preference. Some developers and organizations prefer to use "main" to refer to the default branch, while others continue to use "master".

3) Can you explain the difference between Git and GitHub?

Git is a distributed version control system that was created by Linus Torvalds in 2005. It is a command-line tool that allows developers to track changes to their code, collaborate with others, and revert to previous versions if necessary. With Git, developers can create local repositories on their computers and synchronize their changes with remote repositories hosted on different servers.

GitHub, on the other hand, is a web-based platform that provides hosting services for Git repositories. It was created in 2008 and is now owned by Microsoft. GitHub allows developers to store and manage their Git repositories on remote servers and provides a graphical user interface (GUI) for performing Git operations. It also offers additional features such as bug tracking, issue management, pull requests, and code reviews.

4) How do you create a new repository on GitHub?

  1. Log in to your GitHub account.

  2. Click on the "+" icon in the top right corner of the page.

  3. Select "New repository" from the dropdown menu.

  4. Enter a name for your repository.

  5. Add a description if you like (optional).

  6. Choose whether you want the repository to be public or private.

  7. Select the checkbox to "Initialize this repository with a README" (optional).

  8. Choose a license if you like (optional).

  9. Click "Create repository".

5) What is difference between local & remote repository? 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 repositories are hosted on a server that is accessible for all team members.

Task-1:

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

task-2:

- Create a repository named "Devops" on GitHub.

- Connect your local repository to the repository on GitHub.

git remote add origin <URL>

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

git clone

Create a file in Devops/Git:

git status

git commit -m "message"

- Push your local commits to the repository on GitHub.

Git push : The git push command is used to upload local repository content to a remote repository.

git push -u origin

  • For the Password generate a token from GitHub.

Check it on GitHub Account

Thank You for reading this Article.

More from this blog

Untitled Publication

22 posts