I am quite new with GIT and looking for advice. Accidentally I had set incorrect time and all my commits are with wrong time/date and I would like to shift commit times/dates (f.e +8 hours/ +10 days).
I have found solution for one commit but I was wondering whether it can be done for many commits in one branch. I have managed to figure out how to change date but I am lost with rebasing :
COMMITS=($(git rev-list $COM~..HEAD))
for COMMIT in "${COMMITS[@]}"
do
COMMIT_DATE=$(git log $COMMIT -n1 --format=%aD)
NEW_DATE=$(date -d "$COMMIT_DATE+30 days" -R)
echo "I: $COMMIT FROM $COMMIT_DATE TO $NEW_DATE"
GIT_COMMITTER_DATE="$NEW_DATE" GIT_AUTHOR_DATE="$NEW_DATE" git commit --amend --no-edit --date "NEW_DATE"
...... rebase command
done
Can somebody advise me how to correctly rebase?
Thanks in advance