TL;DR
Use:
git checkout -b master origin/trunk
followed by whatever you will do to copy this Git repository elsewhere. Feel free to delete the remote-tracking name origin/trunk
if you're not going to do any further SVN imports:
git branch -d -r origin/trunk
You can repeat this for each SVN branch name, if you like.
Long
Some things you need to know:
You don't have any branches,1 at the moment:
$ git branch
* (HEAD detached at origin/trunk)
You do have some remote-tracking names (Git calls these remote-tracking branch names, but they are not branch names, so I like to omit the word branch here). Your SVN import created these:
$ git branch -a
* (HEAD detached at origin/trunk)
remotes/origin/svn-branch1
remotes/origin/svn-branch2
The first line is of course a repeat, but it indicates that there is a remotes/origin/trunk
. The extra word remotes
here is from the fact that the full names of each of these is refs/remotes/origin/name
; Git normally omits both refs/
and remotes/
, except for git branch -a
which only omits refs/
on the remote-tracking names (for no apparent reason).
Now, git checkout
won't automatically create a (local) branch name unless there's one matching remote-tracking name. Your SVN import did not create an origin/master
, though it did create an origin/trunk
.
Normally, remote-tracking names exist in your Git repository because of branch names that existed in some other Git repository. If that were the case, you'd need to rename those branches in the other Git repository. But in your case, there is no other Git repository (yet)—there is only an SVN repository. In the SVN repository, there was a name trunk
and your conversion copied that name here.
What you need to do is create the local branch name master
. The simplest command is git checkout -b master starting-point
, as that will also put you on that branch (which you likely want). The starting point is the commit to which you want this new name master
to refer.
1In this context, the word branch means branch name. In other contexts in Git, it means other things. Git branches do not correspond very well to SVN branches. See also What exactly do we mean by "branch"?