git-svn clone fails “fatal: Not a valid object name”

后端 未结 4 684
情歌与酒
情歌与酒 2020-12-03 17:29

Whilst doing git svn clone -s https://svn.example.com/repo/ I received the following output:

r3073 = a6132f3a937b632015e66d694250da9f606b8333 (r         


        
相关标签:
4条回答
  • 2020-12-03 18:01

    You may use git-svn server-side alternative, SubGit in order to avoid many of git-svn translation problems.

    I'm a SubGit developer and could say that we worked a lot to resolve character translation issues like the one above; in this particular case tag would be translated to a refs/tags/Sync+Controllers tag.

    Note also, that git-svn has translated Subversion tag as a branch instead of a tag.

    0 讨论(0)
  • 2020-12-03 18:08

    I believe the problem with spaces is fixed in Git >= 1.8.0 (See: #786942).

    So you should upgrade it.

    I've tested it and it seems to work in the recent version of git.

    See GitHub Home page: https://github.com/git/git

    0 讨论(0)
  • 2020-12-03 18:12

    The tag on SVN has a space in it, but the tag in git had this space converted to %20 (URL encoded). To solve it just manually add a new tag with the verbatim name:

    cd .git/refs/remotes/tags/
    mv Sync%20Controllers Sync\ Controllers
    

    Then run the git svn clone command again.

    (Normally you'd do this with git tag OLDTAG NEWTAG but git was not allowing me to define a tag with a space in. The tag files are simply text files containing the hash of the relevant commit.)

    0 讨论(0)
  • 2020-12-03 18:13

    I ran into this issue today, and considered this branch which contains a pace in it is not important, i just run

    git branch -r -d partialPayment%202.4
    

    And re-run git svn fetch It skipped current branch and continue grabbing the next one.

    0 讨论(0)
提交回复
热议问题