Last active
October 7, 2015 05:57
-
-
Save drmingdrmer/3116181 to your computer and use it in GitHub Desktop.
shell script to find out in which git-branch the last time a file was modified
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
# usage: | |
# ./git-file-branch.sh fn.cpp | |
prev=$(git rev-parse $(git rev-list -n1 --all -- $1)^) | |
for br in $(git branch -a | cut -c 3-); do | |
[ "x$(git rev-list -n1 --no-merges --first-parent $prev..$br -- $1)" != "x" ] && echo $br | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment