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

Re: Getting rid of a stale remote?

From
Tim Visher <tim.visher@gmail.com>
Date
Apr 6, 2010, 18:25 UTC
Message-ID
<x2uc115fd3c1004061125i695f66bbi9f949ccc1958750@mail.gmail.com>
In-Reply-To
<w2if3271551004061107rb25b83b9p19a284f19e7d4f87@mail.gmail.com>
On Tue, Apr 6, 2010 at 2:07 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 5 quoted lines
>> I'm trying to get rid of a stale remote.  I deleted the remote via
>> `git remote rm <remote>` and that removed it from .git/config but for
>> some reason the references stayed in the listing of `git branch -a`.
>
> See `git remote prune`.
From the remote man page:
>   prune
>       Deletes all stale tracking branches under <name>. These stale branches
>       have already been removed from the remote repository referenced by
>       <name>, but are still locally available in "remotes/<name>".
I'm unclear as to how this solves my problem.  Consider the following:
    $ git remote
    a
    b
    c
    $ git branch -a
    a
    b
    c
    remotes/a/branch
    remotes/b/branch
    remotes/c/branch
    remotes/d/branch
    $ git remote prune d
    fatal: 'd' does not appear to be a git repository
    fatal: The remote end hung up unexpectedly
    $ git remote rm d
    error: Could not remove config section 'remote.d'
I would like to get rid of the `remotes/d/branch` entry.
-- 
In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
Previous: Ramkumar RamachandraNext: Jeff King
Message 3 of 5 in “Getting rid of a stale remote?”
  1. Tim VisherApr 6, 2010
  2. Ramkumar RamachandraApr 6, 2010
  3. Tim VisherApr 6, 2010
  4. Jeff KingApr 6, 2010
  5. Tim VisherApr 9, 2010

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.