Last active
January 5, 2024 11:18
-
-
Save RobinDaugherty/d2fcd97d5d1f4edb111f3b67befd67dd to your computer and use it in GitHub Desktop.
Locate dangling git commit containing a matching file path
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
for sha in $(git fsck --no-reflog | awk '/dangling commit/ {print $3}'); do | |
if git show --name-only $sha | grep -q 'apollo-codegen'; then | |
echo "Found in $sha"; | |
git log -n 1 $sha; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment