Help & Support

Merging & Rebasing

Integrating changes from one branch into another can be done via merge or rebase.

Before You Integrate...

Before starting a merge or rebase, you should check a couple of things:

  1. Your working copy should be clean. In case any local changes are present, use Git's Stash to temporarily save them away.
  2. Check out the branch that should receive the changes. The other branch will not be modified by the operation in any way.

Merging Branches

The most common method to integrate one branch into another is to perform a „merge“. To merge changes from another branch into your current HEAD, you can do the following:

  • click the Merge button in the toolbar

Rebasing Branches

When doing a rebase, Git takes all the commits from one branch and reapplies them (like patches) on the other branch one after the other. Thereby, history is rewritten: It will appear as if the commits had been made consecutively on the same branch, not on a different branch. No merge commit will be created, but commits will have new SHA1-IDs.

As a golden rule you should never rebase commits that have already been published on a remote repository (pushed).

To rebase your HEAD branch onto another branch, you can do the following:

  • click the Rebase button in the toolbar

Tip: Learn more about merge & rebase in our learn section.