A Project Manager's guide to using branches in git

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. One of the most important features of git is the ability to create branches to work on specific parts of the project without disturbing the entire source. Every git user is well versed with the "checkout", "branch" and "merge" commands but different developers have their own way of using branches which leads to an unorganized and highly confusing workflow.

I've prepared a basic outline or step-wise procedure to follow while using branches in git. This procedure streamlines the workflow and makes it easy for developers as well as the project manager to work on parallel streams efficiently. 

For the below example, assume "Rahul" is a developer tasked with implementing a new feature and "Shadab" is the project manager. 

  1. Rahul creates a branch from master for his work. Let's call the branch "new_feature_1"
  2. Rahul starts development on that branch.
  3. Rahul pushes to his branch periodically so that others can test his changes and keep a track of the progress.
  4. After the task is complete, he pulls master and checks the difference between master and new_feature_1.
  5. After ensuring he hasn't made any changes not related to his work, he merges master into new_feature_1. This may cause some conflicts, Rahul resolves them.
  6. Rahul informs Shadab that his work on new_feature is complete. Shadab can now pull new_feature_1 and do the final testing.
  7. Finally, Shadab merges new_feature_1 into master. Other developers now have to pull master and follow the steps as efficiently as Rahul did.


How this procedure helps to simplify the workflow:
  1. Each developer is up to date with the progress of complete project as they have to periodically pull master.
  2. The task of comparing changes and resolving conflicts is done by the developer as he is well thorough with his own code.
  3. Only the project manager pushes to master, this helps to protect the main branch from accidental changes/ conflicts. 
  4. Testing is done after merging master into side_branch, which ensures consistency of the new changes with the existing project. 

* FIN *

Comments

Popular posts from this blog

Information passing in Python (Pass by object reference)

Update firefox in Ubuntu from tar.bz2