Created
January 19, 2018 09:14
-
-
Save HoldYourWaffle/36666c383feb5be9f286dc24868a7202 to your computer and use it in GitHub Desktop.
Simple bash script that lists dangling commits with the description of the log entry to identify it. Based on @alexmchale 's ruby version.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git fsck --lost-found 2>&1 | grep "dangling commit" | while read line; do | |
hash="${line:16}" | |
git show --oneline "$hash" 2>&1 | head -n 1; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment