Re: [Feature Request] Allow batch removal of remotes with 'git remote remove'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 21, 2025 at 4:16 PM Emily Shaffer <nasamuffin@xxxxxxxxxx> wrote:
>
> On Mon, Jan 20, 2025 at 3:07 PM Christian Fredrik Johnsen
> <cfj@xxxxxxxxxx> wrote:
> >
> > Hello 😃
> >
> > I would like to propose a feature enhancement to the 'git remote remove' command.
> >
> > --- The Problem ---
> > Currently, 'git remote remove' only supports removing one remote at a time. However, it would be useful to allow batch removal of remotes, as in:
> >
> > `git remote remove remote1 remote2 remote3`
> >
> > This would simplify workflows for repositories with multiple remotes when clean-up operations are needed.
>
> Hi Christian, is there a reason why opening up the config (`vim
> .git/config` or `git config edit --local`) and batch-deleting remotes
> from there is undesirable? If this is a solution you believe only
> power users need, then I'd posit a power user can both list all
> remotes *and* remove the offending ones in a single editor pass,
> rather than having to run multiple `git remote` commands, anyway.

I'd posit a power user can also do something a bit like (Zsh with GNU
or FreeBSD xargs) `print -N my remotes to delete | xargs -0n1 git
remote remove`, or (portably) `for remote in my remotes to delete; do
git remote remove "$remote"; done`.

I couldn't find a comparable command beyond `git branch --delete`,
which _does_ take multiple branches.

-- 
D. Ben Knoble





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux