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

> The remote command is about updating things under .git/refs/remotes,
> not about updating a remote server. For updating a remote server,
> there is really only push. Clear as mud?
>
> It is expected that the person setting up the bare repo is the person
> who knows best which is the "default" branch. Which is why clone uses
> the remote HEAD as the default branch to checkout.
>
> But, if you don't like that, you can always use:
>
> % git clone -b master ...

didn't know that, thanks!

>> Secondly, I don't really understand what is the purpose of "git remote
>> set-head" if the change cannot be transferred to the actual origin
>> repo, so it will start serving another branch as default?
>
> Hmm, the man page says:
>
>       set-head
>           Sets or deletes the default branch ($GIT_DIR/remotes/<name>/HEAD)
>           for the named remote. Having a default branch for a remote is not
>           required, but allows the name of the remote to be specified in lieu
>           of a specific branch. For example, if the default branch for origin
>           is set to master, then origin may be specified wherever you would
>           normally specify origin/master.
>
> This seems clear to me, but I guess if you expect that "git remote"...

terms i'll use here:
remote - instance created using git remote add or by cloning
origin - actual remote repo I cloned from

If it would be exactly as you said then it would probably not be so confusing.
The problem here is that if set-head is only about the remote, then
why after i change it from master to qa and "git show remote origin"
doesn't show this change? Bug? Probably, because "git show remote
origin" actually queries origin for this info and always shows origin
HEAD branch, as Jeff pointed out. If this is the case then there is an
inconsistency between those two commands which caused this confusion.
Please, correct me If i'm wrong but i really think that there should
be a way to not only set it up for remote but also for origin , where
the remote points to if you have push rights of course.

Of course all of this could be avoided if I knew that i have to be
explicit during cloning from my colleagues, because their HEAD may be
pointing to some BUTT, which I don't even want to know about;)

Thanks,
Eugene

      parent reply	other threads:[~2009-12-18 23:55 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
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 [this message]

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=76c5b8580912181555i39484811t3aa641254c07dcce@mail.gmail.com \
    --to=euguess@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=peff@peff.net \
    /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