Updating your changes

Fetch, Rebase and Push

You have started your work, created a local branch based on the last commit of origin/master. During the time you made your changes and now some other changes were integrated into origin/master and you want to update. This can be done by combining two operations. The first is Git fetch to fetch all changes from the origin into your local Git repository. This operation will update the origin/master branch to the state of the remote Git repository. The second operation is Git rebase. This will move any local commits to the new origin/master. The operation is called Git rebase because your local changes will be moved from the old state of origin/master to the current state of it. During the Git rebase local commits can vanish as they are already included, or you can end with a conflict. In that case you will be presented with multiple options, to abort the rebase, to skip (remove) the commit that caused the conflict or to attempt to merge it using the mergetool. Once you have resolved the conflicts use TeamRebase Continue to continue with the next local Git commit..

Procedure 5.10. Fetch and Rebase (textual)

  1. Enter the Contextmenu, select TeamFetch from Upstream.

  2. An overview with changes appear

  3. Enter the Contextmenu, select TeamRebase.

  4. Select the branch you want to rebase against.

  5. On conflict a dialog will ask you to make a decision on how to resolve it. Once it is resolved selectTeamRebaseContinue in the contextmenu to continue with the next commit.

  6. Your branch is now based on the new origin/master

Procedure 5.11. Fetch and Rebase (graphical)

  1. Fetch from Upstream

  2. Result

  3. Begin Rebase

  4. Select Branch

  5. Conflict

  6. Abort

When the rebase goes wrong

When the rebase goes wrong you have two options. You can either select TeamRebaseAbort or if you notice after the rebase the Git Reflog contains your changes before the Git rebase and you can checkout this version again.

External Git mergetool

On OSX and Linux you can use git mergetool on the command line to use opendiff/kdiff3/meld to the merging.