git svn branch导致身份验证失败

时间:2016-01-05 23:27:01

标签: git-svn

我试图通过git-svn完成所有分支和合并,但是我在颠覆中挂断了分支。

我们的管理员告诉我,我对repo有完全的读/写权限,我可以获取最新的代码。

对于测试,我删除了我的~/.subversion/svn.simple目录并运行了它。

04:13 pm [214423L] C:\Dev\MyFooApp.Bar [master]
$ git svn fetch
Authentication realm: <https://code:443> VisualSVN Server
Password for 'cflorell': {my password}

04:14 pm [214423L] C:\Dev\MyFooApp.Bar [master]
$ git svn fetch

04:14 pm [214423L] C:\Dev\MyFooApp.Bar [master]
$

另外,如果我使用Tortoise克隆repo,然后使用svn创建一个分支,它似乎可以工作。

04:43 pm [214423L] C:\Dev\MyFooApp.Bar
$ svn copy https://code/svn/MyFooApp.Bar/trunk https://code/svn/MyFooApp.Bar/branches/test-branch -m "test branch"
Committing transaction...
Committed revision 93.

但是在尝试使用git-svn创建分支时,它仍然说我的身份验证无效。

04:14 pm [214423L] C:\Dev\MyFooApp.Bar [master]
$ git svn branch develop
Copying https://code/svn/MyFooApp.Bar/trunk at r92 to https://code/svn/MyFooApp.Bar/branches/develop...
Authentication failed: Unable to connect to a repository at URL 'https://code/svn/MyFooApp.Bar/trunk': No more credentials or we tried too many times.
Authentication failed at C:\Program Files\Git\mingw64/libexec/git-core\git-svn line 1196.

04:14 pm [214423L] C:\Dev\MyFooApp.Bar [master]
$

我的config文件我认为正确。

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[svn-remote "svn"]
    url = https://code/svn/MyFooApp.Bar
    fetch = trunk:refs/remotes/svn/trunk
    branches = branches/*:refs/remotes/svn/*
    tags = tags/*:refs/remotes/svn/tags/*

我可能在哪里出错?

3 个答案:

答案 0 :(得分:5)

请注意,超过一年后(2017年3月),Git 2.13 +(2017年第二季度)应该避免git svn身份验证问题。

commit e0688e9查看Hiroshi Shirosaki (shirosaki)(2017年3月6日)。

它认识到身份验证在svn branch时失败,而svn rebasesvn dcommit在没有身份验证失败的情况下正常工作。

$ git svn branch v7_3
Copying https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx at r27519
to https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/v7_3...
Can't create session: Unable to connect to a repository at URL
'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': No more
credentials or we tried too many times.
Authentication failed at
C:\Program Files\Git\mingw64/libexec/git-core\git-svn line 1200.
  

我们将身份验证配置添加到SVN::Client->new()以解决问题。

答案 1 :(得分:2)

所以看起来Tortoise SVN和git-svn之间存在冲突,我不确定这是否存在于SVN的其他版本中,但是我卸载了Tortoise SVN然后能够使用{{1}进行分支}

git svn branch branchName

暂时尝试其他SVN浏览器,看看是否也有问题。

答案 2 :(得分:0)

根据https://gist.github.com/kasparsd/3749872/563011118e33900b3a0ca89ec37f3c99be8e9c49,无法使用git svn标签进行身份验证(用于工作,但已停止工作)。

相反,请直接使用svn提交标记:

svn cp <trunk-ul> <tag-url> -m "creating tag x.x"

它会要求以纯文本形式存储您的密码。