git and git-svn and multiple branches and push and fetch

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

  • Is git svn compatible with git subtree?
  • Is Git grafting dangerous?
  • git svn specify branches and tags on a non standard svn repository layout
  • Merging in git: via git-svn, says Already Up-to-date, but git-diff says there are differences
  • Import previous commits using git-svn
  • Which layout to use for git-svn in a project with standard layout currently and non standard layout in past
  • git svn take long time
  • Sending email by using git-send-email
  • 2 Solutions collect form web for “git and git-svn and multiple branches and push and fetch”

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

    from git push:


    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.

    If you have an access to your SVN server, I would recommend 2 steps solution:

    $ subgit install path/to/svn/repository
    $ cd path/to/svn/repository
    $ git push --all <target Git repository>

    Note that the target Git repository should be bare to avoid problems (created by git init –bare command)

    Git Baby is a git and github fan, let's start git clone.