On Fri, Jul 27, 2012 at 12:24:01PM -0700, Jeffery Brewer wrote:

> I'm trying to pull a repository from svn and push it up to Git on a shared 
> server.
This might not be a problem in itself, but since I've seen "z:/" in the
name of the remote repository I should warn you that this might be
a wrong way to work with Git, see [2].

> Here's what I've done so far.
> I created a new directory on my pc.
> Opened a Git Bash in that directory.
> Ran git init
> Ran git svn clone <svn repository address>
> It ran for a very long time and I think it probably downloaded the 
> repository and converted it.
Sort of.  Actually it pulls all the (relevant) history commit by commit
and replays them in your local repository, creating Git commits.

> I went to my new server and created a new directory "my_utilities.git"
> Opened a Git Bash in that directory.
> Ran git init
> This should have created a new bare repository, right?
Wrong.  That had created a new regular repository; to create a bare
repository, run `git init --bare`.

> Then I went back to my pc and ran git push z:\my_utilities.git master
> and I'm getting an error: src refspec master does not match any.
> I'm assuming this means that I don't have a branch called "master" at the 
> server.
Wrong, this means you do not have a branch called "master" in your local
repository.  See below.

> Do I have to go create that manually?

You have two problems here.

First, you blindly assume git-svn will somehow automagically create
something looking like a textbook Git repo.  In reality, git-svn's main
task is to allow a Git developer *continuous* communication with a
Subversion repository, when commits flow in both directions.  This has
certain implications:
* When you first run git-svn, you might tell it whan name you want
  git-svn to know your Subversion repository by; usually people do not
  set it explicitly and git-svn creates a remote named "svn".
  One of the reasons for this is precisely to make remote names and tags
  do not clash with yours.  This means that the branches git-svn fetche
  from that remote become named like "svn/branch", and they *are* the
  so-called remote branches [1].
* I can't recall precisely, but I think the last time I checked, git-svn
  also created a branch for each Subversion tag.

Second, your `git push blah master` appears to be a bindly obeyed
encantation from some blog post or so; please, don't.

So, what I wrote boils down to this: after conversion, you first have to
inspect everything git-svn created in your repository (by running
`git branch -a` (note the "-a"), `git tag` etc), create regular local
branches and tags with sensible naming scheme etc, and only then push
these things to the remote Git repo.  See also [3].

1. http://www.git-scm.com/book/en/Git-Branching-Remote-Branches
3. http://thomasrast.ch/git/git-svn-conversion.html

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to