Git workflow for small teams

A finely tuned git workflow can save you an enormous amount of time over the long run. Over time, I have improved my development process by trying out multiple different strategies. I wanted to share the process I’m currently using that has proven to be successful in a small team environment.

I choose to keep things as simple as possible and use the story branch pattern. All development gets worked on in a local feature branch and pushed to a single remote development branch. Releases are tagged and deployed to production from the master branch. The general workflow for a feature involves the following:

Create a new branch off of development named after the feature.

Work on my feature, continuously committing at regular intervals to keep track of what I’ve done.

Keep my local feature branch up to date from any upstream changes my team has made. This needs to happen often to stay fresh.

Once finished, wrap all of my tiny commits into a single, pretty commit.

Merge local feature branch into development and push it up for the rest of the team.

Delete the feature branch, as it is no longer needed.

If you perform all of those steps manually, it can get quite cumbersome over time and you may find yourself or your team taking shortcuts and not sticking to the process. Fortunately, a lot of this can be automated if you are consistent.

Set up your remote branch

Create a remote development branch from your master branch and track it locally. This is what the team will collaborate on: