Managing git remotes

John Whitley whitley at bangpath.org
Sun Mar 6 19:17:38 CET 2016


Christopher Baines <mail at cbaines.net> wrote:
> The issues I am having here seem to be around managing the git remotes
> in a large number of repositories, so I'm sending a quick email to see
> if anyone is also having this issue, and/or if anyone has some
> tips/solutions for dealing with this?


If I understand correctly, you should be able to do this with either the
new-ish `vcsh foreach` command, or perhaps `mr run`.  vcsh foreach will run the
specified git command (w/ args) in the context of each repo, and can be
particularly handy for issues like this.

Using this approach, write a script that updates the remote(s) in each repo as
needed.  Small scripts can just be aliases in .gitconfig.  See examples at [1].
More interesting scripts can be named using the pattern "git-<name>" and stuck
somewhere on your PATH.  Then you can run `vcsh foreach <name> [args…]` to 
fixup your remotes en masse.

Cheers,
John

[1] https://github.com/jwhitley/dotfiles/blob/master/.gitconfig



More information about the vcs-home mailing list