git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Emily Shaffer <nasamuffin@google.com>
Date
Jan 21, 2025, 21:10 UTC
Message-ID
<CAJoAoZnecm5y8243R9JsGjRDuv-Mb=UAwa+Hbj5CKDKNPBLB4g@mail.gmail.com>
In-Reply-To
<DB9PR05MB110863344D3776D13B436F563C1E72@DB9PR05MB11086.eurprd05.prod.outlook.com>

On Mon, Jan 20, 2025 at 3:07 PM Christian Fredrik Johnsen <cfj@johnsen.no> wrote:

Show 11 quoted lines
>
> 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.

Show 25 quoted lines
>
> --- Proposed Solution ---
> Modify the 'git remote remove' command to accept multiple remote names as arguments and remove them all in a single invocation.
>
> For example:
>
> `git remote remove myfork myrepo origin`
>
> --- Benefits
> - Reduces repetitive commands for users with many remotes.
> - Aligns with existing batch-like behavior in commands like 'git branch -d branch1 branch2'.
> - Streamlines repository maintenance, especially for power users.
>
> Thank you for considering this request. I’d be happy to provide further details or clarification if needed.
>
> Best regards,
> Christian Fredrik Johnsen
>
> =====================================================
> ---> Generated this message with ChatGPT, but it gets to the point.
>
> I am assuming that this is such a niche case that it hasn't been reported yet, though please correct me if I am wrong.
> There are no `github issues` I can search through to find older related issues, so I'll give it a go.
>
> Attached a picture showing the situation where I encountered the issue.
Previous: Christian Fredrik JohnsenNext: D. Ben Knoble
Message 2 of 8 in “[Feature Request] Allow batch removal of remotes with 'git remote remove'”
  1. Christian Fredrik JohnsenJan 20, 2025
  2. Emily ShafferJan 21, 2025
  3. D. Ben KnobleJan 21, 2025
  4. Junio C HamanoJan 21, 2025
  5. brian m. carlsonJan 22, 2025
  6. Jeff KingJan 22, 2025
  7. Junio C HamanoJan 22, 2025
  8. Patrick SteinhardtJan 22, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.