Is this a bug #118569
Replies: 1 comment 1 reply
-
not very sure if this is correct, just trying to help, this is from Copilot suggestion The behavior you're seeing is not a bug, but rather a feature of how Git and GitHub handle timestamps. When you make a commit in Git, the timestamp of the commit is determined by your local system's clock, not by the current time on the server where the repository is hosted. This means that if you change your system's clock, you can create commits with any timestamp you want. When you push these commits to GitHub, GitHub doesn't validate or change the timestamps of the commits. It simply displays the timestamps as they are in the commit metadata. This is why you're seeing the commit as being "created/changed 4 months ago" even though the repository didn't exist at that time. This feature allows developers to accurately preserve the history of their work when importing projects into Git. However, it can also lead to confusing situations like the one you're experiencing if the system clock is not set correctly. If you want to correct the timestamp of the commit, you can do so by amending the commit with the correct date: git commit --amend --date="now" This will change the date of the most recent commit to the current date and time. Note that this will create a new commit with a new hash, so if you've already pushed the commit to GitHub, you'll need to force push the amended commit: git push origin +branch-name Replace |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
I have turned back the clock on my PC and did a commit on a repository under an account that didn't even exist 10 weeks ago. When i committed the changes with the clock turned back, now it says created/changed 4 months ago. How would i have committed anything to a repository which didn't exists. How was i able to connect from VS2022 to a repository that didn't even exist. This seems to be an overlooked bug.
Beta Was this translation helpful? Give feedback.
All reactions