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.
Is there any way so that it shows something like 4 months ago there?
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"