Skip to content

Add a way to sync remote origin with remote upstream #1160

Closed
@goran-w

Description

@goran-w

When working in a typical open-source workflow (for example when contributing to SourceGit on GitHub), there are often two remotes:

  • our own forked repo (origin)
  • the master-repo (upstream)

After a Fetch (from all remotes), the origin branches are often lagging behind the corresponding upstream branches. To sync an origin branch against its upstream, we can use Open In Browser in SourceGit (on the origin remote) and then (on the GitHub repo web page) select "Sync fork (origin) branch with upstream". However, it would be nice if this operation could be performed without leaving the SourceGit UI (at least when fast-forward is possible).

Possible (minimal/partial) implementation:

  • Right-clicking a remote branch origin/develop gives the option Fast-forward to upstream/develop (similar to how it works for local branches).
  • Other variants for syncing between two remote branches could be added later, but fast-forward is arguably the most common and trivial use-case.
  • At least initially, it could be assumed that the remote and upstream branch needs to have the same name in order to be synced?
  • To establish which remote is the upstream, we may need to split the Default Remote dropdown (in Repository Configure) into two separate ones: Default Remote Origin and Default Remote Upstream.
  • Alternatively, a sub-menu per remote could be used (similar to the one used per branch/tag when right-clicking in the log-graph) to enable syncing between arbitrary pairs of remotes (which may not be as "safe" as requiring configuration of a dedicated Origin + Upstream).

Metadata

Metadata

Assignees

Labels

not-plannedIt's not planned in the future

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions