Trying to migrate a large but linear svn repository to git. The svn repository does not have the standard layout (trunk, branches, tags)...just one directory with the trunk.
Also had the issue.
Figured out that git command is case-sensitive and that I was specifying --trunk=trunk/MyLib
instead of --trunk=trunk.Mylib
I managed to resolve it that way.
Hope this helps someone...
I think that you run the correct command. Alternatively you could run
$ git svn clone https://coawstmodel.sourcerepo.com/coawstmodel --trunk=COAWST --authors-file=../users.txt COAWST
git-svn nearly finishes its work in each case. The only thing it tries to do is to set 'master' to point to your trunk. Because of some bug it tries to set it to the wrong value but you can perform it manually with
$ git update-ref refs/heads/master refs/remotes/git-svn
If you will still have problems you may try to convert the repository with SubGit in 3 steps:
$ subgit configure path/to/svn/repository
#edit path/to/svn/repository/conf/subgit.conf to set trunk = COAWST:refs/heads/master and authorsFile = path/to/users.txt
$ subgit install path/to/svn/repository
The converted repository will be at path/to/svn/repository/conf/.git
I had the same problem today.
The problem is probably that the SVN repository does not have a trunk directory. The standard trunk, tags and branches directories seems to be optional in SVN. But git-svn needs to know about this when migrating.
It is also possible that some of the directories are there but named differently. (for example trunk could be named "project" instead of "trunk", branches could be named "branches" as usual and tags could be missing. Or "trunk" could be named "Trunk".)
If there are none of these standard directories in the SVN repo, and everything is just placed in the root of the repo, the solution is simply to not to try clone the standard svn-directories. Just clone the root.
If they exists (or some of them does), but under different names, git-svn has to be told about these names.
I used Tortoise Git to migrate from SVN to GIT. In TortoiseGit, it is done by cloning from the svn repository (yep!) and checking the "From SVN Repository" checkbox.
If there are no trunk, tags or branches directories in the SVN repo, simply uncheck the "trunk", "tags" and "branches" checkboxes in the "From SVN Repository" section of the clone dialog.
If the standard directories are there, but are named differently than normal, keep them checked but write the used names in the textbox next to them.
(From the commandline this can be done with the -T, -t and -b switches. See http://www.sailmaker.co.uk/blog/2013/05/05/migrating-from-svn-to-git-preserving-branches-and-tags-3/ under "non-standard SVN layout").
(Those were the two cases i encountered - more complex cases may exist. I had several SVN repositories with neither trunk, tags or branches directories and unchecking these 3 checkboxes made it work. I also had a case where the trunk dir was called "project" instead of "trunk", but the branches dir was named normally and there were no tags dir. Unchecking the tags checkbox and entering the name of the trunk directory made that case work.)
I believe I have two sets of git binaries installed on my Windows machine:
a. Git (whatever the typical Windows installation is--forgot where I got it). This one installs the "Git Bash Here" choice on the right-click file explorer context menu.
b. Tortoise Git.
I received the error when cloning a non-standard svn repository using "Git Bash" (i.e. Git).
I then tried using TortoiseGit (as suggested by one poster here), and that worked without errors.
However, TortoiseGit displays the actual command line it is using, and I became suspicious because that command line is the same as I used unsuccessfully with Git.
I then tried "Git Bash" again and provided the full path to what I believe is the TortoiseGit git binary, i.e.:
"C:/Program Files/Git/bin/git.exe" svn clone svn://localhost/dtapublic tempgitrepo
and that worked fine.
However,
git svn clone svn://localhost/dtapublic tempgitrepo
causes the error.
I believe there are possibly two git binaries in play, and that is why TortoiseGit cured the problem for one poster. The git binary shipped with "Git" does not work for non-standard svn repositories, and the git binary shipped with "TortoiseGit" does work.
Every time this happened to me Git simply couldn't fetch a commit from trunk
in Subversion:
fatal: refs/remotes/trunk: not a valid SHA1
Reasons:
/trunk
.-r
option).