rewriting history

Replacing existing commits with new ones, for example with amend, rebase or reset, which gives them new IDs.

Rewriting commits others have pulled splits the team's history and can lose their work.

In more detail

Commits can never be edited, so any change to an old commit creates a new commit, and new IDs for every commit after it. That is harmless on work only you have, but commits others have pulled then exist in two versions, so the one hard rule is: never rewrite history anybody else has pulled. Pushing rewritten history needs a force push.

Related terms

Taught in

References

Certification courses