From: Eugene Sajine <euguess@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Jay Soffian <jaysoffian@gmail.com>,
git@vger.kernel.org, Eugene Sajine <euguess@gmail.com>
Subject: Re: git remote set-head not working?
Date: Fri, 18 Dec 2009 12:38:39 -0500 [thread overview]
Message-ID: <76c5b8580912180938s2b885efax33be860f963ba92f@mail.gmail.com> (raw)
In-Reply-To: <20091218165302.GA1746@sigill.intra.peff.net>
> 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
>
Yes. I was trying to change the HEAD on the bare remote (origin) repo
and the concept here is really confusing.
Firstly, when i cloned from some repo "clone" comand is setting HEAD
branch for remote in accordance to where the HEAD is pointing on
origin side. I just recently realized that and i'm not sure it is best
thing to do - i think it should default to origin/master first, if it
doesn't exist then to where the HEAD is pointing.
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? I might not
have access to the server to perform git symbolic-ref on my bare repo
(imagine the repo on github), so it might be not an option.
The problem with this is that it can be screwed up easily (i did
it;)), but the fix is not trivial.
Scenario i hit was:
My colleague created bare repo on the server and performed some
commits and pushed. We've got 3 branches on the server: master, qa and
featureX The repo got screwed up - i was unable to clone because of
repository corruption (another story probably for Shawn as there was
Egit involved;) )
So i tried to recover I cloned from my colleague, but his head was
pointing to featureX so I've got this featureX, when i was expecting
to see master.
I realized that i have to add master and qa as tracking branches for
origin/master and origin/qa.
Then i deleted corrupted server repo, created bare repo using "clone
--bare" and put it on the server. But i didn't know that i have to
checkout to master branch in order for it to be default branch served
from the server before cloning. So i ended up with the featureX being
default HEAD on the server.
That was not user friendly stuff...
And here i am trying to change this setting on the server...
Thanks,
Eugene
next prev parent reply other threads:[~2009-12-18 17:38 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 [this message]
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=76c5b8580912180938s2b885efax33be860f963ba92f@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