Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make fake git commit date? [duplicate]

Tags:

git

commit

I want to change my history.

Is it possible to change commit date or make new commit with outdated date?

I think only about system date changing.

like image 339
tre Avatar asked Sep 12 '17 19:09

tre


People also ask

Can you backdate a git commit?

If you want to commit to a even older date, say 3 days back, just change the date argument: date -v-3d . That's really useful when you forget to commit something yesterday, for instance. Show activity on this post. In my case, while using the --date option, my git process crashed.

Is it possible to change the date and file from the git database?

It implies that, it is impossible to change file, date, and commit message and any other data from the Git database without knowing Git.

How do I hide commit time on github?

Hide commit history on Git Branch First, create a new temporary branch and checkout. Now, add all the current files to this temporary branch. Create a new commit. Rename the temporary branch to your old branch name.

What is rewrite in git commit?

Roughly speaking, if the diff between the old and new version is bigger than the new version itself, it's a "rewrite". This is tuned for git's original use case of changing source files, most often making localised changes: since it is based on a line-by-line diff, things like reindenting a source file can trigger it.


1 Answers

Use the --date option when you commit:

git commit --date "Wed Feb 16 14:00 2037 +0100"

Here are the supported date formats:

https://git-scm.com/docs/git-commit#_date_formats

like image 56
Drew Noakes Avatar answered Oct 23 '22 21:10

Drew Noakes