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.

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.

In this article

Update your local branch

  1. In GitHub Desktop, switch to the local branch you want to update by clicking Current Branch and selecting the branch from the list.
  2. Click Fetch origin to update your branch.
    The Fetch origin button
  3. If there are commits on the remote branch, you can pull these by clicking Pull origin or Pull origin with rebase.
    The Pull origin button
  4. 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

  1. At the top of the app, click Current Branch.

    Current Branch drop-down menu

  2. Click Choose a branch to merge into BRANCH.

    Choose a branch option in the list of branches menu

  3. 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.

    The Merge button

  4. Click Push origin or Force push origin to push your changes to the remote.

    The Push button

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."

  1. Use the Branch drop-down and click Rebase Current Branch.

    Rebase Current Branch in branch dropdown

  2. Click the branch you want to rebase into the current branch, then click Start rebase.

    Start rebase button

  3. If you're sure you want to rebase, click Begin rebase.

    Begin rebase button

  4. Resolve any merge conflicts in your preferred way, using a text editor, the command line, or another tool.

  5. To push up your local changes, click Force push origin.

    Force push origin

Ask a human

Can't find what you're looking for?

Contact us