3

I'm facing a common problem migrating SVN to Git, basically I have some branches (on SVN) named with white spaces. Is there a way to solve or workaround it?

I've found some "solutions" but none of them worked for me.

I have a rude and massive repository to migrate and the command already migrated more then 90% of them (it took more then a week).

Someone has a clue how to solve it?

Git error: command returned error: 128

System Info:

Win 7 64x

git version 1.9.5.msysgit.0

Thanks!

Community
  • 1
  • 1
Idemax
  • 2,712
  • 6
  • 33
  • 66
  • 2
    Nothing to do with your problem but 1.9.5 is far from being current. Latest release is 2.6.2, get it from here: https://git-scm.com/download – eckes Nov 02 '15 at 14:30
  • How are you migrating? `git svn clone`? `svn2git`? Which issues do you experience? – eckes Nov 02 '15 at 14:31
  • What's your SVN version? [https://answers.atlassian.com/questions/309062/answers/3039270 These guys] mention that `svn2git` had an issue with SVN < 1.7.9 and upgrading to 1.7.9 fixed it – eckes Nov 02 '15 at 14:36
  • @eckes I updated to `git version 2.6.2.windows.1` now, I will check. About the command, is that one: `git svn clone --stdlayout --authors-file=authors.txt https://my.svn.repo local-repo-folder` – Idemax Nov 02 '15 at 14:56
  • @eckes I have seen this problem too with svn = 1.7.14, git = 1.8.3.1 and svn2git = 2.3.2 – jplandrain Nov 16 '15 at 14:40

2 Answers2

5

Open the file git-repo-name/.git/packed-refs and replace the %20 for spaces.

Git version: git version 2.6.2.windows.1 (win 7 64x via git bash).

Peter Lillevold
  • 33,668
  • 7
  • 97
  • 131
Idemax
  • 2,712
  • 6
  • 33
  • 66
  • This doesn't seem to fix things, exactly; git spits "warning: ignoring ref with broken name refs/remotes/svn/xxx"; so it seems the branches with spaces in space are just ignored since this is invalid in git. – Flávio Etrusco Oct 01 '21 at 20:56
  • now working for me, I tried doint exactly that, replaced %20 with space but still having same issue on Windows GitBash – pixel Jun 23 '23 at 22:45
  • @pixel thanks for the feedback, consider upvote if this question/answer helped you :) cheers – Idemax Jun 26 '23 at 18:01
-1

For anyone reading this now, and using say an Ubuntu box, which might affect behavior, using the svn2git tool, use both double quotes around the full URL and %20 in place of the spaces. This has worked for me now on a rather large conversion.

gvtek0
  • 1
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 26 '23 at 05:42