Changing History

work in progress, sorry

The need to change history in Git should be minimal and should limited to fixing errors made in previous commits on your local repository.

Here are a few simple tools to help you change your local history.

Consentual Shared Remote History rewriting

If you need to change commit history on a share repository then think about how many people it is going to affect. If you really must change a shared git history, get consent from the people you will affect first.

It is much simpler to commit a new change that fixes the omission or error and let others pull that additional change.

Amend commit

This creates a new commit with both the currently staged changes and the change in the previous commit.

If you forgot to include some changes in the last commit, then this is a way to avoid two commits for the same logical change.

Squash commits

Also see interactive rebasing

Fixing up

results matching ""

    No results matching ""