Hello,in my project I have a payroll system and sometimes I had to change my computer's date in order to test if my system works well, now as you can see I have made 2 previous commits on future dates, my question is what happens when these dates come? Will it override my commits? Because 23 sep and 23 October were supposed to be 23 August, and I have made much much more commits after these two.
Thanks.
Just do git commit --amend --reset-author --no-edit . For older commits, you can do an interactive rebase and choose edit for the commit whose date you want to modify.
If you've already created a fresh commit, you'll want to use git rebase -i to squash your commit on top of the old one. After you've made this change locally, and verified your commit looks the way you want it to, you'll have to git push --force to overwrite history on the Github remote.
Hide commit history on Git Branch First, create a new temporary branch and checkout. Now, add all the current files to this temporary branch. Create a new commit. Rename the temporary branch to your old branch name.
What happens when these dates come? Will it override my commits?
No! Each commit is identified by an unique hash-code based on the actual content plus some metadata (like the IDs of the parent commits).
You could consider to change the date of the commits:
How can one change the timestamp of an old commit in Git?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With