For those using bash, a useful feature:
gcat () { if [ $# -lt 1 ]; then echo "Usage: $FUNCNAME [rev] file"; elif [ $# -lt 2 ]; then git show HEAD:./$*; else git show $1:./$2; fi }
Put it in your .bashrc file (you can use any name other than gcat .
Usage example:
> gcat Usage: gcat [rev] file
or
> gcat subdirectory/file.ext
or
> gcat rev subdirectory/file.ext
Matt Jun 09 '15 at 3:45 2015-06-09 03:45
source share