How to Collaborate Using Git Without Messing Things Up

Minh Pham
Level Up Coding
Published in
6 min readFeb 23, 2020

--

Git workflow which I always use when working together

TL;DR: When you and your collaborators working on the same branch, always use: git pull --rebase and git rebase master

Git has become the most used version source control among millions of companies, projects, and developers. Nothing to say, Git’s branch management is the “killer feature”, which certainly sets Git apart in the VCS community.

“Branching means you diverge from the main line of development and continue to do work without messing with that main line.” — Chapter 3. Git branching, Pro Git, Scott Chacon and Ben Straub

If you are new to git, I recommend you to read the links below, then following my topic will be easier:

Today, I’m going to show you the git workflow which I always use when working on a topic/feature branch. No matter what I work alone or work together with two (including me) or more members of a team. By using this workflow, the benefits you gain will be:

  • Having a clean, linear git history
  • Rewriting history easier
  • Making your coding reviewer’s life easier

So let’s started!

Scenario

Suppose my project has a main branch named master which contains all the production code. One day, my team…

--

--