Last active
September 10, 2021 04:07
-
-
Save tw-Frey/347e9259dafcd7829c4c3248b7e6f1d5 to your computer and use it in GitHub Desktop.
git amend commit and let author date and commit date that both are the same.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @setlocal | |
| @if not [%1]==[] if not [%1]==[--] ( | |
| set GIT_AUTHOR_DATE=%1 | |
| set GIT_COMMITTER_DATE=%1 | |
| set git_date_params=--date=%1 | |
| ) | |
| @if not [%2]==[] if not [%3]==[] ( | |
| set GIT_AUTHOR_NAME=%2 | |
| set GIT_AUTHOR_EMAIL=%3 | |
| set GIT_COMMITTER_NAME=%2 | |
| set GIT_COMMITTER_EMAIL=%3 | |
| set git_author_params=--author="%2 <%3>" | |
| ) | |
| git commit --amend --no-edit %git_date_params% %git_author_params% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment