Remotes

Fix a branch that diverged from its remote

When your branch and its remote both have commits the other doesn’t, Pull and Push can’t simply run. Fix sync shows how the commits will line up, then repairs the branch.

  • 3 min read
  • RepoBeam 1.8
  • Windows & Linux
Local and remote both changed dialog: Put your commits after the remote ones, Replace origin/main with your branch, and Before and After graphs

In short

  • Fix sync appears in the toolbar when your branch and its remote have both moved.
  • By default your commits are placed after the remote ones. Nothing is removed from the remote.
  • After amending pushed commits, you can replace the remote instead, with every replaced commit named first.

Step by step

  1. Click Fix sync

    When both sides moved, the toolbar shows Fix sync with the number of commits involved.

    The toolbar with Fix sync in place of Pull and Push
  2. Check the preview

    Put your commits after the remote ones is selected. The Before and After graphs show where your commits will go.

  3. Repair and sync

    Click Repair and sync. Commits that are already on the remote are skipped. If Git needs a decision, the conflict resolver opens.

  4. Push

    When the branch is repaired, RepoBeam tells you how many commits are ready to push. Click Push.

Replacing the remote after amending

If you amended or combined commits you had already pushed, putting your commits after the remote ones would bring the old versions back. In that case choose Replace origin/main with your branch:

  • RepoBeam lists every commit that will no longer be on the remote.
  • On a branch that is usually shared, such as main, tick I understand before continuing.
  • If anyone pushes before the replacement runs, RepoBeam stops and replaces nothing.
  • The replaced commits are kept on your computer as a recovery point.

RepoBeam suggests replacing the remote only when your local commits look like rewritten versions of the remote ones.