logoalt Hacker News

TazeTSchnitzeltoday at 2:10 AM4 repliesview on HN

I wish there were a shorthand for

  x git commit --amend --reset-author --no-edit
I use that one very frequently (after a fixup, of course) because I want the author date on amended commits to reflect the last time I edited them, not the first time I committed them.

Replies

throw-the-toweltoday at 2:22 AM

But you can make your own alias?

  > git config --global alias.whatever_you_want 'commit --amend --reset-author --no-edit'
https://git-scm.com/book/ms/v2/Git-Basics-Git-Aliases
whateveraccttoday at 4:11 AM

i edit my commit dates constantly for various reasons

get ahead at work? split into commits and make it look like multiple days of work

work on your own IP during work hours? edit the timestamp to be outside work hours (i even have a script for this)