Append actual date and time to git commit message
If you want to append the actual date to all your repository commits you have to create or modify the following file.
.git/hooks/commit-msg
If you want an skeleton file you can copy the sample message with this command
cp .git/hooks/commit-msg.sample .git/hooks/commit-msg
In that file you have to add the following line
echo "`date`" >> $1
Written by Carlos Simon
Related protips
2 Responses
But why? When you call git log <sha>
you will get the date and time of commit.
over 1 year ago
·
I use it because I have a git repository in a USB device for all my classroom notes and exercises, and I want to know when I did the commit in a faster way.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#