Re: Getting rid of a stale remote?

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

 



On Tue, Apr 6, 2010 at 2:42 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Tue, Apr 06, 2010 at 02:25:07PM -0400, Tim Visher wrote:
>>     $ git remote rm d
>>     error: Could not remove config section 'remote.d'
>
> And this fails because you have no configured remote 'd', just the
> crufty branch. How you got into that state, I don't know, but I imagine
> it was from deleting the config in .git/config manually instead of using
> "git remote rm" in the first place.

%<---lengthy but almost assuredly misleading explanation of how I got there--->%

So I had this long explanation but I realized that it probably wasn't
the case.  If I ever run into this again I'll try to be more aware of
what I did.  I suspect though that it's when I want to make one remote
my origin and make origin something else…

> It would be tempting to say that "git remote rm" should continue if the
> config simply doesn't exist and remove the crufty branch, but that is
> not quite right. We actually need the config to tell us "here is where
> we store the tracking branches for remote d". Of course, unless you have
> munged the config manually, it will always be "refs/remotes/d". So we
> could perhaps guess that for the case of missing config (possibly with
> "git remote rm -f" or something).

That sounds quite sensible to me.  Also, a message along the lines of:

    You are trying to delete a remote for which there is no config section.  (We
    discovered a remote X in refs/remotes/X) and deleted it.|No remote X in
    refs/remotes/X. Did you store it elsewhere?)  In the future, use `git
    remote` to alter your remotes

> But if you just want to do things manually, try "git branch -d -r
> d/branch".

That did indeed work like a charm.  Thanks so much.

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]