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

Radheya Zunjur
4 min readJun 28, 2023

--

Welcome back, DevOps Engineers! In our previous article, we explored the fundamentals of Git and GitHub, gaining a solid understanding of version control and collaboration. We covered the basics, such as creating repositories, making commits, and pushing changes to remote repositories. Now, it’s time to take a deep dive and expand our knowledge further.

1) What is Git and why is it important?

Git is a distributed version control system (VCS) that is widely used in software development. It allows multiple developers to collaborate on a project by tracking changes to files and coordinating their work. Git was created by Linus Torvalds, the same person who developed the Linux operating system, to manage the development of the Linux kernel.

In short, Git is important because it allows developers to:

  1. Track changes to files over time and revert to earlier versions.
  2. Collaborate with multiple developers on the same project.
  3. Create independent branches for experimentation and feature development.
  4. Work offline and synchronize changes with a central repository.
  5. Benefit from a vibrant open-source ecosystem and tools like GitHub.
  6. Ensure code integrity, manage versions, and maintain project quality.

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

They are conceptually the same thing. The convention just changed: previously the primary branch was called master and for newer repository that defaults to main . You should only ever have one of those in a single repository (nothing breaks if you have both, but it’s unlikely to be intentional).

In terms of functionality, there is no inherent difference between the “main” and “master” branches in Git. They both serve as the default branch and can be used to develop and organize the project’s codebase. Developers can create additional branches, such as feature branches or bug fix branches, based on either “main” or “master” and merge them back into the default branch when the changes are ready.

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

Git: Git is a distributed version control system (VCS) that allows developers to track changes to files and manage source code history. It is a command-line tool that operates locally on a developer's machine. Git provides features like version control, branching, merging, and collaboration. Developers use Git to manage their codebase, create branches, commit changes, and synchronize their work with others.

GitHub: GitHub is a web-based platform built on top of Git. It provides hosting services for Git repositories and adds a range of collaboration and project management features. Developers can use GitHub to store and share their Git repositories with others. It offers a graphical user interface (GUI), issue tracking, pull requests, code review tools, and more. GitHub also facilitates team collaboration, enabling multiple developers to work together on a project, manage workflows, and contribute to open-source projects.

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

Here are the steps to create a new repository on GitHub:

  1. Sign in to your GitHub account.
  2. Click on the “+” icon and select “New repository.”
  3. Provide a unique repository name, optional description, and choose public or private visibility.
  4. Optionally, initialize the repository with a README file, add a .gitignore file, and choose a license.
  5. Click “Create repository” to create the new repository on GitHub.

5) What is difference between local & remote repository? How to connect local to remote?

Local Repository: A local repository is a copy of a Git repository that resides on your local machine or computer. It is stored on your hard drive and contains all the files, commits, branches, and version history of the project. The local repository allows you to work on the project, make changes, create branches, and commit your changes.

Remote Repository: A remote repository is a repository that is stored on a remote server, often on a platform like GitHub, GitLab, or Bitbucket. It serves as a central location where multiple developers can collaborate on the project. The remote repository stores the collective changes made by different developers and provides a means for synchronization and sharing.

## Tasks
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.
- Create a new file in Devops/Git/Day-02.txt & add some content to it
- Push your local commits to the repository on GitHub

--

--

Radheya Zunjur
Radheya Zunjur

Written by Radheya Zunjur

Database Engineer At Harbinger | DevOps | Cloud Ops | Technical Writer

No responses yet