git-svn migration fatal: not a valid SHA1 update-ref refs/heads/master refs/remotes/trunk: command returned error: 128

Viewed 19029

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.

Ubuntu 12.4 LTS,git 1.7.9.5.

$ git svn clone https://coawstmodel.sourcerepo.com/coawstmodel/COAWST --authors-file=../users.txt COAWST

...

    D   WPS/metgrid/storage_module.F
    D   WPS/metgrid/process_domain_module.F
W: -empty_dir: WPS/metgrid/gridinfo_module.F
W: -empty_dir: WPS/metgrid/input_module.F
W: -empty_dir: WPS/metgrid/interp_option_module.F
W: -empty_dir: WPS/metgrid/module_date_pack.F
W: -empty_dir: WPS/metgrid/process_domain_module.F
W: -empty_dir: WPS/metgrid/storage_module.F
r635 = c19181c9718e701788b540ed0cc559e4fbddf413 (refs/remotes/git-svn)
    M   Tools/Docs/COAWST_User_Manual.doc
r636 = 1b7849c3e5a20856c9ddb909a5f53ddf8501ad33 (refs/remotes/git-svn)
Auto packing the repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
Counting objects: 14143, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (14039/14039), done.
Writing objects: 100% (14143/14143), done.
Total 14143 (delta 8350), reused 0 (delta 0)
fatal: refs/remotes/trunk: not a valid SHA1
update-ref refs/heads/master refs/remotes/trunk: command returned error: 128

I have tried variants with combinations of -s, -t Trunk, -t COAWST, --preserve-empty-dirs (which I would like to do), --no-meta-data (per Pro Git)...always the same final error.

Thanks for any suggestions!

5 Answers

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.

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...

Related