Day-8:Deep Dive in Git & GitHub for DevOps Engineers.

KUNCHEPU HARISHKUNCHEPU HARISH
4 min read
  1. What is Git and why is it important?

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

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

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

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


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

    Two main advantages of using Git at software development:

    • Tracking the changes and updates. We are able to see who made which changes. Git also provides when and why a change was made.

    • Allowing to work collaboratively. Software development projects usually require many people to work together. Git provides the developers with a systematic way of doing that. Thus, the developers focus on the project instead of extensive communication sessions between the other developers.

The terms “main branch” and “master branch” refer to the default branch in a Git repository. The difference between these terms lies mainly in their naming conventions and historical context:

Master Branch

  • Historically, “master” was the default branch name used in Git repositories for many years. It originated from the original version control system called BitKeeper.

  • The “master” branch typically represents the main development branch, where the latest changes and features are integrated before being released or merged into other branches.

  • However, the use of “master” has been recognized as carrying connotations of slavery and oppression, leading to a movement to replace it with more inclusive terminology.

Main Branch

  • In response to the concerns raised about the term “master”, many Git hosting platforms and communities have moved towards adopting more inclusive naming conventions.

  • main” is a commonly used alternative to “master” as the default branch name. It aims to promote diversity and inclusion within the software development community.

  • The “main” branch serves the same purpose as the “master” branch, representing the primary branch for development, integration, and the latest changes.

To view all available branches, use the “git branch” command:git branch

The resultant image shows that all the branches have been listed successfully:

That’s all about the distinctions between the “main branch” and “master branch” in Git

The choice between “main branch” and “master branch” is a matter of naming convention and reflects the evolving language used within the software development community. The branch itself serves as the primary branch for the development, integration, and storage of the latest changes in the repository, regardless of the specific name used. This tutorial has stated about distinctions between the “main branch” and the “master branch” in Git.

Git: Git is a distributed version control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

GitHub: GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features.

How to create a GitHub repository

Developers can follow these 10 steps to create a GitHub repository:

  1. Log into the GitHub administrative console

  2. Move to the GitHub Repositories page

  3. Click on the green “New” button

    • This will bring up the GitHub repo creation wizard
  4. Enter the name of the GitHub repository

  5. Include a description (optional)

  6. Choose to make this a public or private GitHub repository

  7. Add a README (optional)

  8. Include a .gitignore file for your development framework (optional)

  9. Choose a fair use license

  10. Click the green “Create Repository” button to finish the process

Post GitHub repository creation steps

Once the GitHub repository is created, developers will need to obtain the unique GitHub URL associated with it and provide it to other developers and DevOps professionals.

With this URL, developers can clone the GitHub repo along with any Git submodules it may include. Other lifecycle activities include renaming the GitHub repo or deleting a GitHub repo.

However, hopefully it takes a while after a developer creates a GitHub repository that they want to use any rename or delete operations.

0
Subscribe to my newsletter

Read articles from KUNCHEPU HARISH directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

KUNCHEPU HARISH
KUNCHEPU HARISH

Looking for an entry-level position to kickstart my career in a dynamic and progressive company through which I can contribute in design, developing and deploying software that have a purpose and play significant role in company’s growth.