2022-05-24

Git Fast-Forward

Fast-forward merges have properties that are tightly tied together (basically they are equivalent)...

  • A fast-forward merge is exactly the sort of merge that doesn't create a merge commit (assuming that you aren't doing destructive operations on commit history).
  • A fast-forward merge is exactly the sort of merge that just updates the branch pointer. (Remember that `git pull` first does a `fetch` to get the remote commits before the merge happens, so a merge "just updating the branch pointer" can involve commits that didn't exist locally until the fetch.)
  • A merge is fast-forwardable exactly when the source commit history is a superset of the destination branch commit history.
  • A merge is fast-forwardable exactly when the destination commit is an ancestor of the source commit.