* Can someone confirm what the contents of refs/heads/master means?
@ 2008-12-08 19:23 davetron5000
2008-12-08 19:35 ` Peter Harris
2008-12-08 21:26 ` Björn Steinbrink
0 siblings, 2 replies; 6+ messages in thread
From: davetron5000 @ 2008-12-08 19:23 UTC (permalink / raw)
To: git
I'm using git-svn to interact with an SVN repo that has branches.
After my clone via:
git svn clone $REPO/main -T trunk -b branches -t tags
my 'master' branch pointed to one of the branches in svn and not to
the main trunk. (my .git/config looked correct for svn interaction,
i.e. trunk pointed to the right place).
So, I overwrote refs/heads/master with the contents of refs/remotes/
trunk (i.e. the SHA-1 of the svn trunk).
Things seem to be working; git svn dcommit commits to the trunk and
git svn rebase updates from svn's trunk.
So, I want to make sure that refs/heads/master actuall does, in fact,
point to the head revision of whatever branch is considered "master".
Can someone comfirm this (or provide the actual explanation if I'm
wrong?)
Thanks!
Dave
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can someone confirm what the contents of refs/heads/master means?
2008-12-08 19:23 Can someone confirm what the contents of refs/heads/master means? davetron5000
@ 2008-12-08 19:35 ` Peter Harris
2008-12-08 19:42 ` David Copeland
2008-12-08 21:26 ` Björn Steinbrink
1 sibling, 1 reply; 6+ messages in thread
From: Peter Harris @ 2008-12-08 19:35 UTC (permalink / raw)
To: davetron5000; +Cc: git
On Mon, Dec 8, 2008 at 2:23 PM, davetron5000 wrote:
>
> So, I overwrote refs/heads/master with the contents of refs/remotes/
> trunk (i.e. the SHA-1 of the svn trunk).
>
> Things seem to be working; git svn dcommit commits to the trunk and
> git svn rebase updates from svn's trunk.
>
> So, I want to make sure that refs/heads/master actuall does, in fact,
> point to the head revision of whatever branch is considered "master".
I do believe so, yes. That, or an entry in packed-refs.
> Can someone comfirm this (or provide the actual explanation if I'm
> wrong?)
Overwriting internal files by hand feels a little too much like work
for my taste. I would have done something more like "git reset --hard
trunk" (or, if not on master, "git branch -D master; git branch master
trunk" ), but of course you can feel free to do things the hard way if
you prefer. :-)
Peter Harris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can someone confirm what the contents of refs/heads/master means?
2008-12-08 19:35 ` Peter Harris
@ 2008-12-08 19:42 ` David Copeland
2008-12-08 19:55 ` Peter Harris
0 siblings, 1 reply; 6+ messages in thread
From: David Copeland @ 2008-12-08 19:42 UTC (permalink / raw)
To: Peter Harris; +Cc: git
Thanks for the info :)
The reason I edited by hand is when I was on trunk (e.g. git checkout
trunk), I did a git svn dcommit and it worked, but said "you aren't on
a branch", so I was concerned I might be in some weird state (i.e. if
trunk isn't a branch, can I make a branch off of it?)
Dave
On Mon, Dec 8, 2008 at 2:35 PM, Peter Harris <git@peter.is-a-geek.org> wrote:
> On Mon, Dec 8, 2008 at 2:23 PM, davetron5000 wrote:
>>
>> So, I overwrote refs/heads/master with the contents of refs/remotes/
>> trunk (i.e. the SHA-1 of the svn trunk).
>>
>> Things seem to be working; git svn dcommit commits to the trunk and
>> git svn rebase updates from svn's trunk.
>>
>> So, I want to make sure that refs/heads/master actuall does, in fact,
>> point to the head revision of whatever branch is considered "master".
>
> I do believe so, yes. That, or an entry in packed-refs.
>
>> Can someone comfirm this (or provide the actual explanation if I'm
>> wrong?)
>
> Overwriting internal files by hand feels a little too much like work
> for my taste. I would have done something more like "git reset --hard
> trunk" (or, if not on master, "git branch -D master; git branch master
> trunk" ), but of course you can feel free to do things the hard way if
> you prefer. :-)
>
> Peter Harris
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can someone confirm what the contents of refs/heads/master means?
2008-12-08 19:42 ` David Copeland
@ 2008-12-08 19:55 ` Peter Harris
0 siblings, 0 replies; 6+ messages in thread
From: Peter Harris @ 2008-12-08 19:55 UTC (permalink / raw)
To: David Copeland; +Cc: git
On Mon, Dec 8, 2008 at 2:42 PM, David Copeland wrote:
> Thanks for the info :)
>
> The reason I edited by hand is when I was on trunk (e.g. git checkout
> trunk), I did a git svn dcommit and it worked, but said "you aren't on
> a branch", so I was concerned I might be in some weird state (i.e. if
> trunk isn't a branch, can I make a branch off of it?)
Trunk is a "remote branch", so you can't check it out. If you try, you
get what is called a "detached HEAD".
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#detached-head
And, yes, you can make a local branch off of a remote branch.
Peter Harris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can someone confirm what the contents of refs/heads/master means?
2008-12-08 19:23 Can someone confirm what the contents of refs/heads/master means? davetron5000
2008-12-08 19:35 ` Peter Harris
@ 2008-12-08 21:26 ` Björn Steinbrink
2008-12-08 22:21 ` David Copeland
1 sibling, 1 reply; 6+ messages in thread
From: Björn Steinbrink @ 2008-12-08 21:26 UTC (permalink / raw)
To: davetron5000; +Cc: git
On 2008.12.08 11:23:46 -0800, davetron5000 wrote:
> I'm using git-svn to interact with an SVN repo that has branches.
>
> After my clone via:
>
> git svn clone $REPO/main -T trunk -b branches -t tags
>
> my 'master' branch pointed to one of the branches in svn and not to
> the main trunk. (my .git/config looked correct for svn interaction,
> i.e. trunk pointed to the right place).
Just to clear up that bit as well. when the "fetch" finishes (which is
part of the clone process), git-svn checks if there is a master branch,
and if not, it creates one from the last commit it created. So if your
last svn commit was to branch XYZ and not to trunk, master will
reference that commit on branch XYZ.
Björn
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can someone confirm what the contents of refs/heads/master means?
2008-12-08 21:26 ` Björn Steinbrink
@ 2008-12-08 22:21 ` David Copeland
0 siblings, 0 replies; 6+ messages in thread
From: David Copeland @ 2008-12-08 22:21 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: git
Ah, that makes sense (I did another clone of another repo and did not
experience this behavior, so now that all makes sense).
Thanks!
Dave
On Mon, Dec 8, 2008 at 4:26 PM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
> On 2008.12.08 11:23:46 -0800, davetron5000 wrote:
>> I'm using git-svn to interact with an SVN repo that has branches.
>>
>> After my clone via:
>>
>> git svn clone $REPO/main -T trunk -b branches -t tags
>>
>> my 'master' branch pointed to one of the branches in svn and not to
>> the main trunk. (my .git/config looked correct for svn interaction,
>> i.e. trunk pointed to the right place).
>
> Just to clear up that bit as well. when the "fetch" finishes (which is
> part of the clone process), git-svn checks if there is a master branch,
> and if not, it creates one from the last commit it created. So if your
> last svn commit was to branch XYZ and not to trunk, master will
> reference that commit on branch XYZ.
>
> Björn
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-12-08 22:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08 19:23 Can someone confirm what the contents of refs/heads/master means? davetron5000
2008-12-08 19:35 ` Peter Harris
2008-12-08 19:42 ` David Copeland
2008-12-08 19:55 ` Peter Harris
2008-12-08 21:26 ` Björn Steinbrink
2008-12-08 22:21 ` David Copeland
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).