Move ALL git commits dates 1 day into the future
My system time was incorrectly set during a game jam, so all my commits are exactly 24 hours before anyone else’s. I’d like to try doing a filter-branch:
#!/bin/sh git filter-branch --env-filter ' an="$GIT_AUTHOR_NAME" ad="$GIT_AUTHOR_DATE" cd="$GIT_COMMITTER_DATE" if [ "$GIT_AUTHOR_NAME" = "wilbefast" ] then ad=date_plus_one(ad) cd=date_plus_one(cd) fi export GIT_AUTHOR_DATE="$ad" export GIT_COMMITTER_DATE="$cd" '
I can’t figure out how to parse and modify the date though :S I’m not a bash pro I’m afraid; Any ideas?
One Solution collect form web for “Move ALL git commits dates 1 day into the future”
GIT_AUTHOR_DATE and GIT_COMMITTER_DATE are in unix time, so you can just add 24 hours worth of seconds to these values (86400 seconds)
ad=$[ $ad + 86400 ] cd=$[ $cd + 86400 ]