Importance of branching in git hub in project management

Github is a web based git, which is used for hosting and managing the projects or software packages on the web.

Previously, I have had one or two posts published in the same category, but at a very basic level more of like an introduction. Now, the purpose of this post is to focus on the importance of github in the project management and the wonders it can do in managing a project being developed by a number of developers simultaneously.

Now, if you have forked some repository on github and you want to contribute to it in some particular manner, or you just want to work on a particular feature or function of the project repository. The best way to do so is to make a new branch of off the master branch. Although, one can also contribute directly to the master branch as well, but making a new branch and then merging it with the master makes it more convenient and less complex. For managing the branching in github, following commands would help:

Checking the status of your github repository and branches present:

$ git status
$ git branch


This command would reflect the status of available branches in your github. Eg. in Rperform apart from the master branch it has been showing the following "testsuite" branch which I have worked upon for making the test cases for Rperfrom package in GSoC'2017.
master
* testsuite17
Creating and deleting the branches:

To create a new branch use following command works:

$ git branch branchname

To delete the branch use following command, in which branchname refers to the particular branch name one has been targeting.

$ git branch -d branchname

After the creation of branches, changes in the files can be pushed in the form of commits using the same commit commands.
Switching the branches:
Branches can be switched from master to other branches or vice-versa.

$ git checkout -b branchname
$ git checkout master
$ git status

Leave a comment