vcstool icon indicating copy to clipboard operation
vcstool copied to clipboard

Store multiple named remotes

Open christian-rauch opened this issue 6 years ago • 2 comments
trafficstars

As I understand vcs is mainly used to replicate the set of currently tracked git (and others) repos. I often use multiple remotes when working with forks to simplify rebasing on master. E.g. a remote origin pointing to the upstream projects and a remote fork pointing to my fork that contains feature branches.

When having the feature branch checked out, vcs will pick up the fork repo in the url. If I replicate this setup via vcs import on another PC, this fork url will be set to origin again and it will not create the upstream remote. As a consequence:

  • the original upstream repo needs to be manually added to the second workspace (e.g. as remote upstream) to rebase on master
  • the remote names differ between workspaces, e.g. the original upstream repo will be either origin or upstream and the forked feature branch will be either fork/feature or origin/feature

It would be useful, if vcs would store multiple remotes as key-value pairs, e.g.:

url:
  origin: <url to upstream>
  fork: <url to fork>
version:
  - origin/master
  - fork/feature

christian-rauch avatar Mar 21 '19 11:03 christian-rauch

That sounds like an interesting feature. Please consider contributing a pull request to implement this idea.

dirk-thomas avatar Mar 21 '19 17:03 dirk-thomas

Better to use this form:

url:
  origin: <url to upstream>
  fork: <url to fork>
version:
  origin: master
  fork: feature

Because origin/master can be a legit git reference.

andry81 avatar Mar 29 '23 00:03 andry81