git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-svn with multiple remote repositories?
@ 2008-12-02 21:39 Josef Wolf
  2008-12-02 23:07 ` Jacob Helwig
  2008-12-03  8:45 ` Michael J Gruber
  0 siblings, 2 replies; 3+ messages in thread
From: Josef Wolf @ 2008-12-02 21:39 UTC (permalink / raw)
  To: git

Hello,

I am trying to create a git repository with two remote svn repositories
so that I can merge/move patch-sets back and forth between the svn
repositories.

This is what I have tried so far:

  mkdir -p project
  cd project
  git-svn init -R private -s https://foo.bar/repos/private

Then I go and edit .git/config too look like this:

  [core]
          repositoryformatversion = 0
          filemode = true
          bare = false
          logallrefupdates = true
  [svn-remote "private"]
          url       =   https://foo.bar/repos/private
          fetch     =      trunk:refs/remotes/private/trunk
          branches  = branches/*:refs/remotes/private/*
          tags      =     tags/*:refs/remotes/private/tags/*
  [svn-remote "public"]
          url       =   https://foo.bar/repos/public
          fetch     =      trunk:refs/remotes/public/trunk
          branches  = branches/*:refs/remotes/public/*
          tags      =     tags/*:refs/remotes/public/tags/*

And finally, I do

  git-svn fetch -R private
  git-svn fetch -R public

Both commands seem to fetch the contents from their origins.  But
git-branch shows me only the local master branch with contents from
the "private" svn repository.  When I do

  git checkout public/trunk

the contents actually change to reflect the "public" svn repository,
but git-branch says I am on "(no branch)" at all.

As a newbie to git, I am somewhat confused now.  Any hints how I can
get a hold on the remote branches merge between them?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-svn with multiple remote repositories?
  2008-12-02 21:39 git-svn with multiple remote repositories? Josef Wolf
@ 2008-12-02 23:07 ` Jacob Helwig
  2008-12-03  8:45 ` Michael J Gruber
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Helwig @ 2008-12-02 23:07 UTC (permalink / raw)
  To: Josef Wolf; +Cc: Git

No branch for your checkout is correct. Try something like: git  
checkout -b foo public/trunk

On Dec 2, 2008, at 13:39, Josef Wolf <jw@raven.inka.de> wrote:

> Hello,
>
> I am trying to create a git repository with two remote svn  
> repositories
> so that I can merge/move patch-sets back and forth between the svn
> repositories.
>
> This is what I have tried so far:
>
>  mkdir -p project
>  cd project
>  git-svn init -R private -s https://foo.bar/repos/private
>
> Then I go and edit .git/config too look like this:
>
>  [core]
>          repositoryformatversion = 0
>          filemode = true
>          bare = false
>          logallrefupdates = true
>  [svn-remote "private"]
>          url       =   https://foo.bar/repos/private
>          fetch     =      trunk:refs/remotes/private/trunk
>          branches  = branches/*:refs/remotes/private/*
>          tags      =     tags/*:refs/remotes/private/tags/*
>  [svn-remote "public"]
>          url       =   https://foo.bar/repos/public
>          fetch     =      trunk:refs/remotes/public/trunk
>          branches  = branches/*:refs/remotes/public/*
>          tags      =     tags/*:refs/remotes/public/tags/*
>
> And finally, I do
>
>  git-svn fetch -R private
>  git-svn fetch -R public
>
> Both commands seem to fetch the contents from their origins.  But
> git-branch shows me only the local master branch with contents from
> the "private" svn repository.  When I do
>
>  git checkout public/trunk
>
> the contents actually change to reflect the "public" svn repository,
> but git-branch says I am on "(no branch)" at all.
>
> As a newbie to git, I am somewhat confused now.  Any hints how I can
> get a hold on the remote branches merge between them?
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-svn with multiple remote repositories?
  2008-12-02 21:39 git-svn with multiple remote repositories? Josef Wolf
  2008-12-02 23:07 ` Jacob Helwig
@ 2008-12-03  8:45 ` Michael J Gruber
  1 sibling, 0 replies; 3+ messages in thread
From: Michael J Gruber @ 2008-12-03  8:45 UTC (permalink / raw)
  To: Josef Wolf, git

Josef Wolf venit, vidit, dixit 02.12.2008 22:39:
> Hello,
> 
> I am trying to create a git repository with two remote svn repositories
> so that I can merge/move patch-sets back and forth between the svn
> repositories.
> 
> This is what I have tried so far:
> 
>   mkdir -p project
>   cd project
>   git-svn init -R private -s https://foo.bar/repos/private
> 
> Then I go and edit .git/config too look like this:
> 
>   [core]
>           repositoryformatversion = 0
>           filemode = true
>           bare = false
>           logallrefupdates = true
>   [svn-remote "private"]
>           url       =   https://foo.bar/repos/private
>           fetch     =      trunk:refs/remotes/private/trunk
>           branches  = branches/*:refs/remotes/private/*
>           tags      =     tags/*:refs/remotes/private/tags/*
>   [svn-remote "public"]
>           url       =   https://foo.bar/repos/public
>           fetch     =      trunk:refs/remotes/public/trunk
>           branches  = branches/*:refs/remotes/public/*
>           tags      =     tags/*:refs/remotes/public/tags/*
> 
> And finally, I do
> 
>   git-svn fetch -R private
>   git-svn fetch -R public
> 
> Both commands seem to fetch the contents from their origins.  But
> git-branch shows me only the local master branch with contents from
> the "private" svn repository.  When I do
> 
>   git checkout public/trunk
> 
> the contents actually change to reflect the "public" svn repository,
> but git-branch says I am on "(no branch)" at all.

You want "git branch -a" if you want to see all branches including
remotes. "master" happens to reflect "remotes/private/trunk" because the
first fetch set it up like that. Further fetches will not change master.

Remote branches are your local copy, but different from local branches:
you're not supposed to check them out, and if you do anyways, you get a
"detached HEAD". Well, your repo gets a detached HEAD...

If you want to work with remote branches, create a tracking branch: a
local branch that is based on a remote one and that is set up to rebase
(or merge) new commits from the remote:

git checkout -b mypublic/trunk remotes/public/trunk

You can name the local branch any way you want, even "public/trunk", but
that may lead to confusion when you look at the output of "git branch
-a" which suppresses the "remote/" part.

Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-03  8:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-02 21:39 git-svn with multiple remote repositories? Josef Wolf
2008-12-02 23:07 ` Jacob Helwig
2008-12-03  8:45 ` Michael J Gruber

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).