Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- git add somefile.txt
- git hash-object somefile.txt
- git show 5a5bf28dcd7944991944cc5076c7525439830122
- git ls-tree -r HEAD | grep <SHA1>
- git rev-list <commit-list> | xargs -n1 -iX sh -c "git ls-tree -r X | grep <SHA1> && echo X"
- git ls-tree <commit-sha1>
- #!/bin/sh
- obj_hash=$1
- # go over all trees
- git log --pretty=format:'%T %h %s'
- | while read tree commit subject ; do
- git ls-tree -r $tree | grep "$obj_hash"
- | while read a b hash filename ; do
- if [ "$hash" == "$obj_hash" ]; then
- f=$filename
- echo $f
- break
- fi
- if $f ; then break; fi
- done
- if $f; then break; fi
- done
Add Comment
Please, Sign In to add comment