2

I tried to change the message of a commit.

git rebase -i HEAD~5

I've tagged the commit with reword and edited message in second window

git push
git pull
git reset --hard HEAD~1
git push -f

The last two steps remove the duplicate of commits.
Now is all fine but the commit is "authored 6 days ago" but listed in todays date.
But I would like to have them on their original date.

See here. Commits from Aug 03, 2013 should be in Jul 28, 2013.

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Lucas
  • 3,376
  • 6
  • 31
  • 46
  • 2
    possible duplicate of [git rebase without changing commit timestamps](http://stackoverflow.com/questions/2973996/git-rebase-without-changing-commit-timestamps) – CharlesB Aug 03 '13 at 13:45

1 Answers1

1

First off, the date a commit appears on GitHub (in /commits) is the date you git push.

The original author date is separate, and always preserved when you use git rebase to fixup or reword. So, you'll probably need to do one of two things to have the dates be consistent:

  1. Timetravel. Obviously a no-go (for now).
  2. Force-delete the commit and re-commit it, then push it the same day.

The GitHub <user>/<repo>/commits/<branch> route is an activity log.

In addition, rebasing already-pushed commits is commonly considered a horrible practice, as it messes badly with the git repo's history, so keep that in mind.

Amelia
  • 2,967
  • 2
  • 24
  • 39