Git Hack: Make commit with a past date

Search for a command to run...

Good stuff.
Though be wary of amending commits (message) when working with other developers. It rewrites the commit which would result as different on those who already pulled it.
You can always commit using:
GIT_AUTHOR_DATE="Wed Sep 24 14:12:30 2020 +0530" GIT_COMMITTER_DATE="Wed Sep 24 14:12:30 2020 +0530" git commit -m "message"
Been using this trick for years to show clients that the work is consistent over a span of days when in reality I’d build it in the first day or so.
Also, the amend one is fine if the commit is an unpushed commit (repo is local-only still).
Saifur Rahman Mohsin notice when i mentioned "when working with other developers".
Lee Hansel Solevilla Yeah, I did. Absolutely agree with your point.
The series content will mostly cover Git and GitHub tutorials and my recent learnings and experience in Git.
GitHub recently released a feature that allows users to create a profile-level README to showcase. This article walksthrough how to access this new feature. Why READMEs? The GitHub profile-level README feature allows more content than the profile bi...
All you need to know about Hacktoberfest 2021

Hello reader! Well, Hacktoberfest is something, you are gonna hear a lot about in the coming month. You can refer to my YouTube video Tutorial to see a working tutorial for better understanding and a step-by-step guide of the same. https://www.yo...

Hello reader! In this Blog post, I will share some useful code snippets and functions in Python. Give it a read. Let's get started! 1. Memory The method getsizeof can be used to retrieve the size of any object. Here's an example of the same. import...

Hello reader! Whenever a client sends a request to the server, the response always contains a status code. You might not see it always but it's returned at every client-server interaction. Well, even if you are not a programmer, you would still know...

Hello reader! Microsoft subsidiary GitHub launched Copilot to power pair programming with AI. In this blog post, I will share all you need to know about it. You can refer to my YouTube video Tutorial to see a working tutorial for better understandin...

Hello reader!
Ever wanted to commit something to a git repo with a past date? Here’s how you could do it.
If you are working on a project and missed a commit yesterday or you accomplished the task but GitHub for Windows bailed on you? Well, this little hack can solve your problem. Check the YouTube video tutorial for live demonstration and better Understanding.
Pre-Step. Pull all data from remote to the local repository.
For the same, we are using the --amend and --date switches. The exact command is as follows:
$ git commit --amend --date="YYYY-MM-DD HH:MM:SS"
Simple isn't it!
And with that, it's a wrap! I hope you found the article useful! Share in the comments below. I create content about Career, Blogging, Programming, and Productivity, If this is something that interests you, please share the article with your friends and connections. You can also subscribe to my newsletter to get updates every time I write something!
Thank you for reading, If you have reached so far, please like the article, It will encourage me to write more such articles. Do share your valuable suggestions, I appreciate your honest feedback!
I would strongly recommend you to Check out the YouTube video of the same and don't forget to subscribe to my Channel. I would love to connect with you at Twitter | LinkedIn.
You should definitely check out my other Blogs:
See you in my next Blog article, Take care!!