On Thu, 15 Nov 2012 02:17:08 -0800 (PST)
smith jack <thinke...@gmail.com> wrote:

> i use git svn to clone svn repo locally, then i push this local git
> repo to github, 
> after that, i am surprised to find that there is only one branch
> named master on github, why? there should be more branches on it
> rather than only one..
> in fact, there are more than 20 svn branches on the svn repo from
> which i using git svn clone.

The problem is that you did not tell us anything of interest about what
do you have in your Git repo and, more importantly how did you do that
"the i push this local git repo to github" step.  I mean, there's no
way to "push a repo", there's only a way to push several branches
(and/or tags) from a local repo to a remote, and which remote
"refs" (branches, tags etc) will be updated by which local refs depends
of your local repo configuration and the way you called `git push`.

Hence if you created a local repo using `git svn` and then just added a
remote repo at github, to push all your 20 branches to github you'd
need to mention all of them in your push command, like this:

$ git push github 'refs/heads/*'

Another thing to note is that when doing initial fetch, `git svn`
creates the so-called "remote" branches out of your Subversion
branches, and it only creates one "your" branch, "master", out of the
Subversion repo's "trunk" (or whatever you told `git svn` to use).
In the end, after `git svn` finished its initial fetch, you will end up
with just a single branch "master" in your local repo--all the other
branches will be accessible as "remotes/branch1", "remotes/branch2" etc,
and you only see them using `git branch -a`.
So there's the question of what you really intend to push to the
github's remote repo.

Now, if it's still not clean for you why you ended up with just "master"
in your github remote, we need more info from you to make educated
guesses; precisely, we need:
1) The output of `git branch` performed in your local repo.
2) How precisely did you call `git push`.

Note that `git push` prints you a summary of what it did, namely what
has been updated with what on the remote side.  It also tells you that
a branch has been newly created on the remote etc.  Just pay attention
to it.


Reply via email to