From: "Adeodato Simó" <dato@net.com.org.es>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: "Marc-André Lureau" <marcandre.lureau@gmail.com>, git@vger.kernel.org
Subject: Re: Deleting remote branch pointed by remote HEAD
Date: Wed, 21 Jan 2009 15:41:42 +0100 [thread overview]
Message-ID: <20090121144142.GA18093@chistera.yi.org> (raw)
In-Reply-To: <49773240.7090605@drmicha.warpmail.net>
* Michael J Gruber [Wed, 21 Jan 2009 15:33:36 +0100]:
> Marc-André Lureau venit, vidit, dixit 21.01.2009 14:02:
> > Hi
> > I deleted a remote branch which was pointed by HEAD, this way: "git
> > push origin :master"
> > Then for almost every git command, I get this error: "error:
> > refs/remotes/origin/HEAD points nowhere!".
> You're talking about about the remote git repo, aren't you?
> > I found this situation non-friendly. Fortunately, I could understand
> > what's going on. But a new user might be confused.
> > Shouldn't the remote HEAD branch be updated or "protected" in some
> > ways? Or should the "error" be considered as a "warning" (silently?)
> > What do you think?
> I think that git said
> "warning: updating the currently checked out branch; this may cause
> confusion,
> as the index and working tree do not reflect changes that are now in HEAD."
> after your push and that this may have rung some bells. I also think
> that pushing to a non-bare remote repo (one with a worktree checked out)
> is strongly advised against in multiple places, unless you know what
> you're doing - which you seem to do since you were able to restore your
> HEAD ;)
I don't think Marc-André was pushing to a non-bare repo, but it doesn't
really matter, because his issue also shows up with bare repos: if you
delete the branch to which HEAD points in a remote repo, you get no
warning, and then cloning that bare repo does not fully work, because
its HEAD points to a non-existent ref.
% g clone ssh://.../foo.git
% cd foo
% g push origin :master
% cd ..
% g clone ssh://.../foo.git foo2
...
warning: remote HEAD refers to nonexistent ref, unable to checkout.
What would git usefully do in this situation, I don't know. But I
thought I'd clear up the above confusion.
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Truth is the most valuable thing we have, so let's economize it.
-- Mark Twain
next prev parent reply other threads:[~2009-01-21 14:43 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 13:02 Deleting remote branch pointed by remote HEAD Marc-André Lureau
2009-01-21 14:33 ` Michael J Gruber
2009-01-21 14:38 ` Marc-André Lureau
2009-01-21 15:24 ` Michael J Gruber
2009-01-21 15:41 ` Marc-André Lureau
2009-01-21 16:19 ` Jeff King
2009-01-21 18:30 ` Daniel Barkalow
2009-01-21 19:09 ` Boyd Stephen Smith Jr.
2009-01-21 19:12 ` Jeff King
2009-01-21 19:14 ` Jeff King
2009-01-21 19:50 ` Daniel Barkalow
2009-01-21 19:53 ` Jeff King
2009-03-12 9:02 ` Felipe Contreras
2009-03-12 11:39 ` Jeff King
2009-03-12 12:47 ` Felipe Contreras
2009-03-12 12:50 ` Jeff King
2009-01-21 20:42 ` Junio C Hamano
2009-01-21 18:31 ` Felipe Contreras
2009-01-21 19:16 ` Jeff King
2009-01-21 19:20 ` Felipe Contreras
2009-01-21 14:41 ` Adeodato Simó [this message]
2009-01-21 14:52 ` Sitaram Chamarty
2009-01-21 22:56 ` GUI and detatched HEAD (was Re: Deleting remote branch pointed by remote HEAD) Daniel Barkalow
2009-01-22 14:20 ` Sitaram Chamarty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090121144142.GA18093@chistera.yi.org \
--to=dato@net.com.org.es \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=marcandre.lureau@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).