tags:

views:

49

answers:

1

A git svn clone with --stdlayout get me multiple branches if the source SVN repo has multiple branches (and tags).

I want to push all of them to another git repo. The git svn clone did seem to have retrieved all the history for all the versions. Is this a matter of giving better instructions to git push?

Here's my possibly misguided workflow intention.

  1. run git svn to clone svn into a private repo.
  2. push it to a shared repo managed with gitosis
  3. make a shared work branch
  4. various people the gitosis-managed repo, make private branches, and merge into the shared work branch.
  5. I pull from the shared repo back to the one I created in step 1, merge to trunk, and dcommit.

Here's the output of git branch -a after running the git svn clone.

/Users/benson/x/tsk/tsk_git_svn git branch -a
* master
  remotes/origin/master
  remotes/sleuthkit-3.0
  remotes/sleuthkit-3.1
  remotes/tags/sleuthkit-3.0.0
  remotes/tags/sleuthkit-3.0.1
  remotes/tags/sleuthkit-3.1.0
  remotes/tags/sleuthkit-3.1.0b1
  remotes/tags/sleuthkit-3.1.1
  remotes/tags/sleuthkit-3.1.2
  remotes/tags/sleuthkit-3.1.3
  remotes/tags/sleuthkit-3.1.3b1
  remotes/tags/sleuthkit-3.2.0b1
  remotes/tags/sleuthkit-3.2.0b2
  remotes/trunk
+2  A: 

you can try a git push --mirror to be sure to push all references from one git repo to another:

from git push:

--mirror

Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository.
Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end.

But I would recommend svn2git (if you don't plan to regularly update your svn repo), in order to get actual tags instead of "branches" for tags.

VonC
@VonC thanks very much. Running push --mirror shows signs of pushing it all. But git clone on the resulting repo doesn't show them in the results.
bmargulies
@bmargulies: When you `push --mirror` from `gitRepo1` to `gitRepo2`, you should get everything on `Repo2`. But why would you then clone `gitRepo2`? Or did you mean git clone the first repo (the one you should try to `push --mirror`)?
VonC
@VonC I edited to clarify my perhaps silly plans. I will look at your alternative tool, as well.
bmargulies
@bmargulies: the plan looks good (not silly at all ;) ) Except when you will clone the gitosis repo, you won't track all remote branches from the beginning: see http://stackoverflow.com/questions/67699/how-do-i-clone-all-remote-branches-with-git (that is assuming the mysterious '`git clone`' you mention is the one made by the "various people", cloning your gitosis-managed repo)
VonC