post-checkout-build-status /

Filename Size Date modified Message
1.3 KB
66 B
1.7 KB
3.0 KB
3.4 KB
65 B

What is this?

Have you ever..

  • pushed a feature branch which fails a build, only to discover you've branched off a bad ref and the tests have already been fixed on master?
  • accidentally performed a release of a bad ref that's failed a build?

If so, this post-checkout hook is for you! Everytime you checkout a ref, this hook will ping your Bamboo or Stash server to check the current build status of the checked out commit.


Requires Ruby 1.9.3 or newer.

Once Ruby's installed, there's a curlable install script you can use. From the root of your repository just run:

sh <(curl -s

Follow the prompts, and you're done!

What does it look like?

$ git checkout 2.3
Switched to branch '2.3'
e1f46e72 has 3 green builds.

$ git checkout master
Switched to branch 'master'
99c42ebd hasn't built yet.

$ git checkout 2.2
Switched to branch '2.2'
Warning! db058541 has 1 red build.


From the root of your repository run:

rm .git/hooks/post-checkout .git/hooks/*-config.yml