Change Git Commit Date and Git Commit Author Date

To see the author and commit date, do the following in terminal:

git log --pretty=fuller

 

 

Need to change the author date and the commit date on your last git commit?

Do the following in terminal:

git commit --amend --date='Fri Jan 20 14:00:29 2017 -0700'
GIT_COMMITTER_DATE="Fri Jan 20 14:00:29 2017 -0700" git commit --amend

 

To see what your git times look like, do a git log --author='your author name' to see the format and your timezone. The timezone in the above example is -0700

 

To see what your author name is (for 'your author name') run git config user.name

 

For older commits, do the following (using the <hash> that’s right before the commit you wish to edit):

git rebase -i <hash>

 

Then, at the one you want to commit, change pick to edit and exit edit mode. Follow the instructions above and when you’re done run git rebase --continue

 

Double check with git log --pretty=fuller

You’re all set!

git

Leave a Reply

Your email address will not be published. Required fields are marked *