Converting a subversion repository to git, why am I seeing “fatal: not a valid object name”?
I am seeing the following output while converting a subversion repo to git.
> Found possible branch point: <repo-url>/trunk => <repo-url>/branches/CMT_PHASE3, 18441 > fatal: Not a valid object name refs/remotes/BlueSimViewer 5.0 20110316 Branch > cat-file commit refs/remotes/BlueSimViewer 5.0 20110316 Branch: command returned error: 128
The command I am running to convert the repo is
This process has already converted 117 branches, some with spaces in their names. I first found this SO question, which helped me move forward from a previous issue solved by git 1.8.x.x.
Any insight as to the cause of this problem and possible ways of fixing it are greatly appreciated.
I am running git version 220.127.116.11 on an Ubuntu 12.10 server. I am happy
to provide any other information that would be helpful.
2 Solutions collect form web for “Converting a subversion repository to git, why am I seeing “fatal: not a valid object name”?”
I found a solution, but I am not satisfied with the result. If someone can provide a way to do this without ignoring the problematic branches, then I am happy to accept his or her answer.
For each branch/tag that throws this error, open the following file
and place a pound symbol (#) at the start of the line containing the offending branch/tag.
For example, with respect to my question
This marks the line as a comment, and git will continue the conversion process while ignoring the problematic branch.
I am still converting at the time of writing this answer. Although this solution means some branches are missed, at least I will know what branches aren’t there.
Might be too late now but I guess I found a, at least, odd solution.
Open the file
git-repo-name/.git/packged-refs that you mentioned and replace the
%20 for spaces, save the document and try again. Worked for me.
Edited in Notepad++ with UTF-8.
git version 2.6.2.windows.1 (win 7 64x via git bash).