Skip to content

Instantly share code, notes, and snippets.

@AAugustine
Last active January 16, 2021 17:12
Show Gist options
  • Select an option

  • Save AAugustine/faa37003f031fa409452e253f4000ff5 to your computer and use it in GitHub Desktop.

Select an option

Save AAugustine/faa37003f031fa409452e253f4000ff5 to your computer and use it in GitHub Desktop.
Merge Strategies

Fast Forward

  • One of the two Most Common
  • git rebase In this most commonly used merge strategy, history is just one straight line. When you create a branch, make some commits in that branch, the time you’re ready to merge, there is no new merge on the main branch. That way main’s pointer is just moved straight forward and history is one straight line.

Recursive

  • One of the two Most Common
  • git merge --no-ff In Recursive merge, after you branch and make some commits, and there are some new original commits on the "main" branch. At merge time, git recurses over the branch and creates a new merge commit. The merge commit continues to have two parents.
Fast Forward Recursive
No new commits on the main branch New commits on the main branch
A linear history Commit 2 parents
No merge commits A merge commit is created
git rebase git merge --no-ff

There is nothing right or wrong with either one of the strategies but with a fast forward merge you have a straight line of history and with recursive merge it is made up of multiple lines.

Ours

Octopus

Resolve

Subtree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment