git svn branch results in Authentication failed

非 Y 不嫁゛ 提交于 2020-02-21 10:34:52

问题


I'm trying to do all of my branching and merging via git-svn, however I'm hung up on the branching in subversion.

Our admin tells me that I have full read/write permissions on the repo, and I CAN fetch the latest code.

For a test, I deleted my ~/.subversion/svn.simple directory and ran this.

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]
$

Also, if I clone the repo using Tortoise, and then create a branch using svn it appears to work.

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.

But upon trying to create a branch using git-svn, it still says my auth is invalid.

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]
$

My config file is I believe correct.

[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/*

Where might I be going wrong with all of this?


回答1:


Note that more than a year later (March 2017), Git 2.13+ (Q2 2017) should avoid that git svn authentication issue.

See commit e0688e9 (06 Mar 2017) by Hiroshi Shirosaki (shirosaki).

It recognizes that authentication fails with svn branch while svn rebase and svn dcommit work fine without authentication failures.

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

We add auth configuration to SVN::Client->new() to fix the issue.




回答2:


So it looks like there is a conflict between Tortoise SVN and git-svn, I'm not sure if this exists in other versions of SVN or not but I uninstalled Tortoise SVN and was then able to branch using git svn branch branchName

C:\Files\Source\Repos\applications\core\App01>git svn branch branchName
Copying http://url/svn/company/applications/core/App01/trunk
 at r7071 to http://url/svn/company/applications/core/App01/
branches/branchName...
Found possible branch point: http://url/svn/company/applications/core/App01/trunk => http://url/svn/company/applications/core/App01/branches/branchName, 7071
Found branch parent: (refs/remotes/origin/branchName) f8ba2fd450c30d4812b7549217eae1b2d5c7dd00
Following parent with do_switch
Successfully followed parent
r15037 = 52dd759833fd89c7be03f89093aba38090b3288f (refs/remotes/origin/branchName)

C:\Files\Source\Repos\applications\core\App01>

Going to try some other SVN Browser for the time being and see if that also has an issue.




回答3:


According to https://gist.github.com/kasparsd/3749872/563011118e33900b3a0ca89ec37f3c99be8e9c49 , there's no way to authenticate using git svn tag (used to work, but stopped working).

Instead, use svn directly to submit a tag:

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

It will ask to store your password in plain text though.



来源:https://stackoverflow.com/questions/34623108/git-svn-branch-results-in-authentication-failed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!