Home > database >  How to change Date/ Time of push in github repo?
How to change Date/ Time of push in github repo?

Time:08-04

I have my school project that I have to submit as an final year project. I have commit history from last 4 months starting from March 3 (when I starting working on my project). I want to push the code on github. But when I push it, the repo shows current time.

enter image description here

Is there any way so that it shows something like 4 months ago there?

enter image description here

CodePudding user response:

I helped my friend in school project with this.

Change the date whatever you want format: Year Month Day Hour Minute

GIT_AUTHOR_DATE=$(date -j -f '%Y%m%d%H%M' 201610160012) GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" git commit -s -m "Your message"

Another version

GIT_AUTHOR_DATE=$(date -d'2022-03-18 18:30:18') GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" git commit -s -m "message"
  • Related