Add the following to your ~/.gitconfig
file
[alias]
cat = "!git show \"$1:$2\" #"
And then try this
git cat BRANCHNAME FILEPATH
Personally I prefer separate parameters without a colon. Why? This choice mirrors the parameters of the checkout
command, which I tend to use rather frequently and I find it thus much easier to remember than the bizarro colon-separated parameter of the show
command.