Figure out who to blame with git
I learned two new git commands today, when I was trying to track down who added a bug into our project. I knew what the code was, and which file it was in, I just didn't know who added it.
git blame <path/to/file>
showed me a commit hashes and authors for every line within the file I gave it, which told me who was to blame.
I wanted to see what all was done in this commit so that I could see how we missed that bug. I copied the commit hash for that line and then used:
git show <commit hash>
to see the entire offending commit. Bulls-eye.
Written by Miles Matthias
Related protips
1 Response
If you are using Emacs, vc-mode has a nice blame interface (vc-annotate) which I can highly recommend.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#