Benefits of GitHub Repository

What are the benefits of GitHub repository in a software development. What are Public and Private repository, Branches, Pull request, CI/CD Pipeline.
GitHub is one of the most important parts of a software developer. GitHub help us to create a repository. In Git repository will have all your code, all files and will maintain the history of each file the number of times it has been modified and committed by the developer. We can create two types of repositories in GitHub as Private and Public

Before starting with GitHub, let's check few of the important terminology used in the GitHub. They are as follows Branch, Pull request, Clone, Fork, Remote and Upstream.

Let's understand what the different benefits of the GitHub are as follows:

  • Public & Private Repository
  • Branches
  • Code History
  • Pull Request
  • CI/CD Pipeline
  • Collaboration
  • Code safety

Public & Private Repository

One of the most important benefits of GitHub is we can create the private or public Git repository. So what actually the public and private git repository is. 

What is GitHub Private Repository?

Here if we are saying a Git repository is Private on that code available in the private repository is not accessible to other users. It can be accessed by only by authorized users. It is created confidential projects or in an internal project where code security is major concern.

What is GitHub Private Repository?

Public git repository is the repository code is accessible by all the users. Here public repository does not require any kind of authentication. All user having the repository URL will be able to download the code. Public repository is meagerly used in the open-source projects. 

Branches

Branch in Git repository is used for creating a separated isolated repository of the master repository. Branch will help developer to make change into the code without touching the mail code or the master code. 

Branched in git help us to manage the code as per bug, feature or by story. Here to merge the branch with main we need to create the pull request. It helps better code management as per changes.  The main feature of Branches in Git is Isolation, lightweight, current development, good for experiments.

Whenever we create a branch at that time Gir will create a new isolated repository same as master. In this branch you can safely and independently commit your code.  So here question is coming why we need a branch. We need a branch for feature-based development, Bug fixing and for written code review. It provides better team based development.

Code History

Code history of Git help of the manage the previous change made on a specific piece of code. Whenever any user commit the code Git take the at the time a unique snapshot of current project state gets created. The commit history contains all the detail like author, commit date, user added comment. It helps us to keep the better track of why the specific change have been made and what the change have been made in the code.

Pull Request

Pull request is a request which is designed to "pull" the changes from one branch to another branch. If a user created a branch for and wanted to merge it with main or master branch on that case, he needs to create a pull request. 

Pull request help the other team member to review the written code for better collaboration. Through pull request other team member can provide his feedback to improve the code quality. Whenever we create a pull request at that time build validation take place. It makes sure that the current code is breaking the current the build or not.

So how exactly pull request work, so for this first create a branch, commit your changes, push the changes to the repository, after this we will need to create a pull request. In this we need to provide the clear title, detail about the change and the reviewer's names and other necessary detail. After creating the pull request, you need to review the code changes. Merge your changes into the mail branch. On merging the code, you will get option to delete the current branch.

CI/CD Pipeline

CI/CD pipeline is one the automated tool available in GitHub. Here CI stands for "Continuous Integration" and CD stands for "Continuous Deployment. Development. CI/CD pipeline provide automated environment to deploy the code builds in different environment. From example from dev to staging and staging to PROD.

Here whenever a developer push a code changes CI create a Pull request and validation of code changes, compiling the code and running the test on the committed code. Here with the help if CI we will be able to catch the build error in early stage.

After passing the validation from the CI GitHub perform the CD or continuous deployment to push the change to different environment like from Dev to Staging.

Befits of CI/CD are catching build error on early stage, automated environment to reduce manual work, improve code quality, better team collaboration, time saving, better software code maintenance. 

Collaboration

Collaboration in GitHub is process. Which provide an efficient process to manage the software development process. Here teams van work together in better and efficient manner. The key feature of collaboration is pull request, creating branched by change, automatic code deployment and better issue tracking.

Code safety

As all we know GitHub provide a very powerful safe and secure environment for the code and better control on code repository. GitHub allow user to create the public and private repository. Here private repository is accessible for group of people and public repository. On other hand public repository to available all the users.

Post a Comment