My git flow

Git flow can make or break your day. Below is what has worked reliably well for me. It keeps me working with no nasty conflicts.

We use locally hosted git. It’s really the only version control software I’ve ever used. We have a master and develop branch. Master is what is currently on production and develop is well…what we are developing on right now. We create branches off of our develop branch, do the feature/bug fix work, submit the PR and then its merged back into develop. On the day before release we tag develop and push it to master. Testers test on master then on release night its promoted to live.

It works decently well for us, especially since we are a rather large set of teams scattered geographically. But it does take some work to get your flow correct so you don’t constantly have conflicts.

Starting from the develop branch. Make sure you have the latest.
git pull

Create your branch and do your work.
git checkout -b feature/magicalunicorn

You’ve wrapped up your work, all the UTs pass and it looks great. Let’s get the latest from develop and make sure it works with the other features being developed along side yours.
git checkout develop
git pull
git checkout feature/magicalunicorn
git pull
git merge develop

The second git pull is the key here. It makes sure you are absolutely on the latest, even though you just worked on the latest. It updates all the references for any submodules(which are a giant pain and wish were never created) and any created/deleted files.

I hope this helps. Would love to hear your feedback.