looking for some solutions? You are welcome.

SOLVED: What the author of commits is supposed to do with the author date on history rewriting (Git)?


I saw many questions about how to fiddle around with author dates and committer dates when rebasing and/or squashing, but I don't grasp the why yet.

It seems to be clear that whether another person is applying a commit on behalf of its author, the committer information will be differentiated (actually, that person is not rewriting anything). What about rewriting the history of a local (own) branch before pushing it into the remote repository?

The author has several options:

  • Modifying the author date to match the committer date.
  • Modifying the commiter date to keep it the same as the author date.
  • Do nothing.

Consider something like this:

Obviously, the default rebase will make both dates diverge in the rebased commits (and commits ahead can have older author dates!). The squash will create a completely new commit. I don't care about keeping it pretty, but, is this meaningful? What are in this case the semantics of both dates?

Thanks in advance.

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots

No comments: