Reputation: 3953
In certain cases I may want to mask the exact date and time of work done and would like to reset the dates on a collection of work without throwing away the commit history as a whole.
How can I rewrite the dates on all commits?
Upvotes: 3
Views: 642
Reputation: 3953
I looked around a bit and found nothing answering this exact question. The easiest solution seems to be:
git filter-branch -f --env-filter 'GIT_COMMITTER_DATE="`date`"; GIT_AUTHOR_DATE="`date`"'
git push -f origin master
Upvotes: 2