Git append the current commit hash to result of a commit command

Posted by farzan on Stack Overflow See other posts from Stack Overflow or by farzan
Published on 2012-10-16T10:57:53Z Indexed on 2012/10/16 11:00 UTC
Read the original article Hit count: 310

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about git

Related posts about git-alias