Skip to content

Commit

Permalink
added git-find-commit-containing-exact-same-file.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
br-cpvc committed May 23, 2023
1 parent cdc0088 commit e0835cf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions git-find-commit-containing-exact-same-file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#from: https://www.reddit.com/r/git/comments/ja0ro8/given_a_specific_file_how_can_i_find_on_which/

#find_by_hash() {
hash=`git hash-object $1`
git rev-list --all -- $2 | while read rev
do
git ls-tree -r "$rev" | grep $hash >/dev/null && echo "$rev"
done
#}
#find_by_hash()

0 comments on commit e0835cf

Please sign in to comment.