O'Reilly logo

Pragmatic Version Control Using Git by Travis Swicegood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Merging Changes Between Branches

These branches are great for organizing your repository, but you need to be able to share changes between branches. This is done through merging.

Merging does exactly what it sounds like. It takes two—or sometimes more—branches and merges them into one. There are a couple of different ways to merge changes between branches. This section covers the following:

  • Straight merges take the history of one branch and the history of the other branch and attempt to merge them together.

  • Squashed commits take the history of one branch and compress—or “squash”—it into one commit on top of another branch.

  • Cherry-picking a commit pulls a single commit from a different branch and applies it to the current branch.

Straight ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required