Git Work Flow for Remote Teams

When your working with a remote team maintaining a good workflow is essential to ensure that projects are delivered properly and code base is managed without many conflicts. This is mostly from our own workflow where the team lead is based in one country and the team members are on a another country working remotely from home.

We use Bitbucket to manage our source code at the moment and have been using it for the past 3 years without any issues.

So our workflow for a project is like this. For each project I create a main repository which will be the production version. Then I create a fork of it as a staging version.

Then I give read access to that staging version to each remote developer who then create their own personal forks. Which they clone for their local working copy.

So in this approach the production version and staging version stays isolated from any developer changes. All the developer changes are consolidated at the staging level and tested before pushed out to the production repository.

Developer will do their changes and commit and push the changes their Dev repository on Bitbucket. Then from there the developer will send a pull request to the staging repository. This is when the team lead will do a code check and accept the changes into the staging version. If there are any discrepancies the team lead can reject the pull request at this point.

We are using Source Tree which is provided by Bitbucket for our local git management. I find it easy to get new developers to use Git using the GUI tool than the CLI commands.

Workflow process

Create Production Repository

 

 

 

 

 

 

 

 

 

 

Create a Fork of that Production Repository as a Staging Repository

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Give Read Access to each developer to the Staging Repository

 

 

 

 

 

 

 

 

 

 

 

 

 

Developer creates a fork of the Staging Repository to create their Dev Repository

Developer then creates a local clone of their developer repository to do changes and development

Hope this helps you to figure out how to structure your git workflow for your remote team. I have kept this process simple as possible.

Note: This might not work for a large remote team working on a single project. We used this mainly for a small team about 4 members working on the repository.

Why Bitbucket?

  • Its free upto 5 users.
  • It allows private repositories for free.
  • Even the paid plan is so much cheaper than competition.
  • Their desktop GUI tool is full featured.
  • Reliablity – We have used Bitbucket for about 3+ years without any issues now.
  • Easy integration with other Atlassian tools like JIRA.
Advertisements

Conflicts when syncing branch with master on bitbucket

If you get a conflict when syncing the branch with the master. First checkout the branch on your local machine and then run the following command to merge the changes from master.

$ git merge --no-ff -m 'Merged in master (pull request #40)' remotes/origin/master

Then manually resolve the conflicts before committing and pushing again.