Created
October 24, 2017 20:42
-
-
Save umamiMike/152c1f7a5f6ecc3f3568b7e235413b38 to your computer and use it in GitHub Desktop.
gitdiff filelist
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
#!/bin/bash | |
# usage: gitdiff {another branch} | |
# will show the files which are different between the branch you are currently on | |
# and the other branch | |
# I use it to remind myself which files I have been editing | |
# TODO: pump it into quickfix in vim | |
while getopts ":h:" opt; do | |
case ${opt} in | |
h) | |
echo "this command lists all files in the current branch which are DIFFERENT from the branch you supply as an argument" | |
esac | |
done | |
if [ -z $1 ]; then | |
echo "you must supply a branch name or commit sha as an argument" | |
else | |
thisbranch=$(git branch |grep '\*' | cut -d ' ' -f2) | |
echo $thisbranch | |
git diff origin/$1...$thisbranch --name-only | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment