loading...
Cover image for Git Hack: Make commit with a past date

Git Hack: Make commit with a past date

ayushi7rawat profile image Ayushi Rawat Updated on ・1 min read

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.

Pre-Step.
Pull all data from remote to 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!

This should solve your problem . If you have any Queries or Suggestions, please reach out to me in the Comments Section below.

Also, have look at my other blogs:

Have fun!

If you have any Queries or Suggestions, please reach out to me in the Comments Section below.

Posted on by:

ayushi7rawat profile

Ayushi Rawat

@ayushi7rawat

Software Engineer at TCS | Technical Blogger | YouTuber | Passionate about learning new stuffs | Like to read | Music calms my soul

Discussion

pic
Editor guide