More Git Goodness

Git Show

Show a particular commit with git show

git show HEAD^^^

It will show the entire commit as a diff.

Set git to output color

git config --local color.ui auto

This will add the following to your .gitconfig file:

[color]
  ui = auto

Git Bisect

Try to find where in the version history a bug first appeared.

# start bisect
git bisect start

# set good point: there was no bug here, this can be a tag, SHA1, or HEAD~18 ...
git good v1.2.6

# set bad endpoint: we know it had shown up by here
git bad master

# bisect will select a commit half way between good and bad
# test ... then tell git if its good or bad
git bisect good

# it will split the other half in half
git bisect bad

# when you've found the bad commit, reset the branch with
git biset reset

Tags:

Category: