Re: [RFC/PATCH] remote: add new sync command
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Nov 7, 2011, 18:35 UTC
- Message-ID
- <CAMP44s358k4EsCg+K6MeLEU4eLbb4mWyX9AdAf4P9CHvf9Lrwg@mail.gmail.com>
- In-Reply-To
- <20111107172218.GB3621@sigill.intra.peff.net>
On Mon, Nov 7, 2011 at 7:22 PM, Jeff King <peff@peff.net> wrote:
Show 26 quoted lines
> On Mon, Nov 07, 2011 at 06:07:12PM +0200, Felipe Contreras wrote: > >> This is useful to mirror all the branches in the current repo to >> another. >> [...] >> +'sync':: >> + >> +Synchronizes local branches with certain remote. This is useful to backup all >> +the branches in a local repository to a remote one, regardless of what upstream >> +is configured for each branch. >> ++ >> +With `--prune`, remote branches will be deleted if they are not also locally. >> ++ >> +With `--new`, local branches that are not yet in the remote will be pushed too. >> ++ >> +With `--all`, basically both `--prune` and `--new` will be selected. >> ++ >> +With `--force`, existing branches will be forced to update, like `git push >> +--force`. >> ++ >> +With `--dry-run`, all the changes will be reported, but not really happen. > > Why is this in "git remote", and not "git push"? The former is usually > about managing the configuration of remotes, not about actually doing > the ref transfer (the "-f" flag excepted, but that is clearly just > calling out to "fetch").
I don't know, seems logical to me what 'git remote sync' does, but 'git push sync'? That sounds weird, and there are no 'git push foo' commands.
> And how does this differ from "git push --mirror"? It looks like you > have more options for what pushing all versus pruning, but wouldn't it > be better for "git push" to grow those options?
But how? --mirror is just an option, I want a separate command, with it's own options.
Cheers.
-- Felipe Contreras