Skip to content

Instantly share code, notes, and snippets.

@bitmess
Created June 5, 2017 06:50
Show Gist options
  • Save bitmess/1906665780536a4b7d042ddcc68b7b83 to your computer and use it in GitHub Desktop.
Save bitmess/1906665780536a4b7d042ddcc68b7b83 to your computer and use it in GitHub Desktop.
git log for one file
#!/bin/sh
PATH=$1
if [ ! -f "$PATH" ];
then
echo "path is nil"
exit 0
fi
DIR=`/usr/bin/dirname $PATH`
FILENAME=`/usr/bin/basename $PATH`
echo "dir : $DIR , file : $FILENAME"
cd $DIR
/usr/bin/git log --all -p -- "$PATH" > ~/Desktop/__log__.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment