Re: Getting rid of a stale remote?
- From
Tim Visher <tim.visher@gmail.com>
- Date
- Apr 9, 2010, 02:08 UTC
- Message-ID
- <m2nc115fd3c1004081908t15ee034bha4909b56621b4936@mail.gmail.com>
- In-Reply-To
- <20100406184256.GA14281@coredump.intra.peff.net>
On Tue, Apr 6, 2010 at 2:42 PM, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> 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…
Show 7 quoted lines
> 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