I've been struggling for a while trying to create the following alias (displays the very first commit of the tree's history) in my .gitconfig
:
[alias]
first = log $(git log --pretty=format:%H|tail -1)
However, I get the following exception:
fatal: ambiguous argument '$(git': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
I have been trying several alternative versions of the command, without being able the get it right.
I would like to create it manually, inside the .gitconfig
file and not by providing the command in the terminal (i.e. git config --global
).
Does anybody have any idea of what might go wrong in this one? I'm on my baby-steps in unix/terminal :-)
EDIT I want to be able to have the same results with the alias as when running the command from the terminal. That is, author, SHA, date, commit message and not only SHA.