Find lost commit by commit message
After deleting its branch, I wanted to find a certain commit that was now unreachable. Couple ways to do that:
git fsck --unreachable
This will display a list of unreachable commits. If you don't regularly run "git gc" this list may be too long to search through.
git log -g --grep="foo bar"
-g will include dangling commits and --grep will search through commit messages.
Written by Kamil Tusznio
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#