Skip to content

Instantly share code, notes, and snippets.

@HoldYourWaffle
Created January 19, 2018 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save HoldYourWaffle/36666c383feb5be9f286dc24868a7202 to your computer and use it in GitHub Desktop.
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.
#!/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