Git append the current commit hash to result of a commit command
- by farzan
I want to append the hash of the ongoing commit to its result. I can retrieve the hash using this command:
git log --format=%H | tail -1
Then I try to merge a commit with command above and make an alias in '.gitconfig', like this:
[alias]
ci = !git commit && git log --format=%H | tail -1
But this does not work; parameters of alias are send to tail command, not git commit.
How should I create this alias?