1

I widely use the git rebase --interactive technique, as this allows to keep the history lean and mean. For example, if I have a branch of 3 commits: a->b->c, and then I discover that the commit a has a misprint, I would prefer to modify the commit a directly instead of creating a commit d that fixes the issue. For sure the history changes (we have now a branch of a'->b'->c' commits), but the dates shown in git bash reflect the initial history of the commits. In other words, if the commit a is created yesterday, the commit a' also has this creation date as shown in git log.

But that is not true if the history is viewed from the Bitbucket commits history. Somehow Bitbucket ignores the dates that git bash uses, and shows the actual dates of modification (e.g. today).

So my first question is: which dates do git bash and Bitbucket use, and what is the difference? The follow up question is more practical: what is the best way to perform the interactive rebase that preserves the dates of commits as shown in Bitbucket?

Dmitry Kuzminov
  • 6,180
  • 6
  • 18
  • 40

1 Answers1

1

Try for testing to do your rebase with the --committer-date-is-author-date option illustrated here by torek.
You will need to do it as an aditional non-interactive rebase, once your interactive rebase is done, since that option is incompatible with -i.

But the idea is to check if BitBucket show the committer date (last modification: today), vs. author date (commit creation date).
See by contrast how GitHub uses those two dates.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250