Skip to content

Instantly share code, notes, and snippets.

@cletusw
Last active August 13, 2019 19:00
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cletusw/7d2c8614a4a20fc27ad6 to your computer and use it in GitHub Desktop.
Save cletusw/7d2c8614a4a20fc27ad6 to your computer and use it in GitHub Desktop.
git bisect run
Quick git tip: Most of you know (and love) git's "bisect" command, but how many have used "git bisect run"? Specify a shell script/command, and git will automatically run it on each bisect step. If it exits with a 0, the commit is marked "good". Anything else, and the commit is marked "bad".
For example, want to find the cause of a failing test?
git bisect start <failing commit> <passing commit>
git bisect run sh -c '(cd app && grunt test)'
Voila! Git will automatically find the first commit in the given range that fails the tests.
http://git-scm.com/docs/git-bisect#_bisect_run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment