The answers to How to modify existing, unpushed commits? describe a way to amend previous commit messages that haven't yet been pushed upstream. The new messages inherit the timestamps of the original commits. This seems logical, but is there a way to also re-set the times?
相关问题
- mySQL alter table on update, current timestamp
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- How to convert from Timestamp to Mongo ObjectID
- Emacs shell: save commit message
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- BFG Repo Cleaner – Alternative to Fresh Clone
if it is previous last commit.
if you already push to orgin and can force use:
if you can't force the push and if it is pushed, you can't change the commit! .
If you want to perform the accepted answer (https://stackoverflow.com/a/454750/72809) in standard Windows command line, you need the following command:
Notes:
^
), but I didn't succeed.Many thanks go to a blog post by Colin Svingen. Even though his code didn't work for me, it helped me find the correct solution.
I created this npm package to change date of old commits.
https://github.com/bitriddler/git-change-date
Sample Usage:
You will be prompted to choose the commit you want to modify then to enter the new date.
If you want to change a commit by specific hash run this
git-change-date --hash=[hash]
There are already many great answers, but when I want to change date for multiple commits in one day or in one month, I don't find a proper answer. So I create a new script for this with explaintion, hope it will help someone:
The date will be changed: