Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git svn branch results in Authentication failed

Tags:

git-svn

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?

like image 958
Chase Florell Avatar asked Jan 05 '16 23:01

Chase Florell


1 Answers

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.

like image 92
VonC Avatar answered Oct 05 '22 07:10

VonC