Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Eugene Sajine <euguess@gmail.com>
Cc: Jay Soffian <jaysoffian@gmail.com>, git@vger.kernel.org
Subject: Re: git remote set-head not working?
Date: Fri, 18 Dec 2009 11:53:03 -0500	[thread overview]
Message-ID: <20091218165302.GA1746@sigill.intra.peff.net> (raw)
In-Reply-To: <76c5b8580912180825t17bfc90eq20dfc05cafa8c02e@mail.gmail.com>

On Fri, Dec 18, 2009 at 11:25:54AM -0500, Eugene Sajine wrote:

> i have a repo cloned from the server with two branches master and qa.
> 
> $git remote show origin
> 
> tells me that the HEAD branch is master.
> 
> When i try to execute
> 
> $ git remote set-head origin qa
> 
> It prints nothing and "git remote show origin" still prints that HEAD
> branch is master.
> 
> Could you, please, advise if I am i missing something.

Hmm. It probably worked, but what you are being shown is a bit
confusing.

"git remote show" will actually query the remote server to find where
its HEAD is pointing. But "git remote set-head" is about changing your
_local_ idea of where the remote head is pointing (in general, "git
remote" does not change anything on the remote side. It is about
managing the local configuration of your remotes).

AFAICT, there is no way to use "git remote" to query the result of your
set-head. And the "show" output makes no distinction between the two.

Perhaps we should print both in "git remote show" if they differ.
Something like:

   HEAD branch: qa (remote points to "master")

or

   HEAD branch (local): qa
   HEAD branch (remote): master

That would clear up the confusion of what is happening. Whether that is
what you actually wanted, I don't know. If you want to be able to refer
to "origin/qa" as "origin", then you're fine. But if you wanted to
actually change the remote repository's idea of HEAD so that further
clones will clone "qa" by default, then you can't do that with "git
remote". You would have to go to the remote repository and run "git
symbolic-ref", I think.

-Peff

  reply	other threads:[~2009-12-18 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-18 16:25 git remote set-head not working? Eugene Sajine
2009-12-18 16:53 ` Jeff King [this message]
2009-12-18 17:38   ` Eugene Sajine
2009-12-18 21:28     ` Jay Soffian
2009-12-18 21:42       ` Junio C Hamano
2009-12-18 22:24         ` Jay Soffian
2009-12-18 23:55       ` Eugene Sajine

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=20091218165302.GA1746@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=euguess@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@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