Syncing your branch
As commits are pushed to your project on GitHub, you can keep your local copy of the project in sync with the remote repository.
In this article
- Update your local branch
- Merge another branch into your project branch
- Rebase your project branch onto another branch
You must sync your local branch with the remote repository to get any additional commits that have been added to the upstream branch since you originally created your branch.
Update your local branch
- In GitHub Desktop, switch to the local branch you want to update by clicking Current Branch and selecting the branch from the list.
- Click Fetch origin to update your branch.
- If there are commits on the remote branch, you can pull these by clicking Pull origin or Pull origin with rebase.
- Resolve any merge conflicts in your preferred way, using a text editor, the command line, or another tool.
Merge another branch into your project branch
At the top of the app, click Current Branch.
Click Choose a branch to merge into BRANCH.
Click the branch you want to merge into the current branch, then click Merge BRANCH into BRANCH.
Note: If there are merge conflicts, GitHub Desktop will warn you above the Merge BRANCH into BRANCH button. You will not be able to merge the branches until you have resolved all conflicts.
Click Push origin or Force push origin to push your changes to the remote.
Rebase your project branch onto another branch
Some workflows either require or benefit from rebasing as opposed to merging. By rebasing you can reorder, edit, or squash commits together. For more information, see "About Git rebase."
Use the Branch drop-down and click Rebase Current Branch.
Click the branch you want to rebase into the current branch, then click Start rebase.
If you're sure you want to rebase, click Begin rebase.
Resolve any merge conflicts in your preferred way, using a text editor, the command line, or another tool.
To push up your local changes, click Force push origin.