Github flow

How I Learned to Love git (most of the time)


I'm totally unqualified to do any real 'git' training.

This is just a process that has kept the git-disabled
like myself from accidentally blowing up projects.

master is deployable


All the time, anytime. Master should be stable.

Continuous Integration - master gets deployed.

do all work in feature branches


Branch off of master to do work.

Name your branch something that makes sense.

git checkout -b my-new-feature

git checkout -b fix-login-form

git checkout -b node-clustering

...etc...

commit locally and push feature branches


(code code code) (save) (oh shit this is master)
git checkout -b new-branch-not-master

(code code code) (save)
git commit -am 'More stuff I just did'

(I should back this up to bitbucket)
git push bucket new-branch-not-master

use pull requests to merge back into the master branch


Once the feature is stable enough to be deployed, open a pull request.

Another developer should take a look at the pull request, scan the changes for anything obviously bad, give feedback if necessary, pull down the branch and test it locally to make sure it works as reported.

If everything works, he should merge the pull request.



deploy immediately


Once you've merged a pull request, deploy immediately to your CI server and let everyone check it out.

This avoids big bugs and keeps up momentum.

useful tools


  • git fetch (remotename)
  • git remote add (remotename) (git url)
  • eg: git remote add bucketĀ git@bitbucket.org:directvcom/dtv-dtve-1.5.git
  • git branch -a
  • git checkout -b (newbranchname)
  • git reset --hard head
  • git stash save
  • git push (remotename) (branchname)
  • git branch -d (branchname)

Github flow

By hunterloftis

Github flow

  • 2,338