Rebasing Your Dev Branch

  • Rebase your development branch with new changes from the golden repository's master. 'upstream/master' is the remote tracking branch for the golden repository's (upstream's) master branch, on your local machine:

git checkout <dev branch>

git rebase upstream/master

  • If there are conflicts, Git will throw an error message informing you so and ask you to resolve it before continuing the rebase.  Resolve conflicts the same way you resolve an ordinary merge conflict in Git. Here's a way to resolve conflicts from the command line.  Then, just continue the rebase operation:

git rebase --continue

  • If the conflict is complex or problematic, you can abort the current rebase operation instead of continuing, and come back to it later:

git rebase --abort

  • After the rebase is complete, you might want to clean up your branch's commit history:
  • Squash all your commits into ONE SINGLE COMMIT.

git checkout <dev branch>

git rebase -i --fork-point master