Question

I'm using git-svn with a couple of work projects and I've noticed that for just about every action I take, I get prompted for my Svn password. For some actions, I get prompted multiple times (presumably b/c there are several actions going on behind the scenes). For example, when cloning a repository, I'm prompted 5 times before the cloning actually begins.

Projects for which I'm using Svn directly don't do this. Is this expected? Is there anything I can do to cache my credentials?

Thanks.

Was it helpful?

Solution

I ended up having to delete the auth directory all together and allow Subversion to rebuild it for me. Nothing else seemed to work. For anyone who doesn't know, the auth directory is in ~/.subversion (Mac/Linux).

OTHER TIPS

I had a similar problem in Sierra. svn worked fine with the stored credential, but git svn would not use the stored credential, and kept prompting for it to be re-entered.

The solution for me was to delete the stored key in keychain, and then use git svn before any other program. If git svn was the program to store the password in keychain, then the permissions were properly set. Once git svn had been used to create the entry in keychain, then normal svn could be used, and allowed to access the key created by git svn, at this point they would both use the repository without any issues, and without me being prompted for the password all the time.

If any other program set the password in keychain, then that program had no problems, but git svn would not be given permission.

You should ask SVN to cache your credentials:

# $ svn update --username 'user2' --password 'password'
# user1@domain.com's password:

However, as mentionned in the SO question Subversion ignoring “—password” and “—username” options, check what exactly is prompting you for a password.

Maybe a stupid idea, but I found git-svn was re-prompting for password even after resetting the keychain entry. So I changed the Access Control for that item so "all applications" can access it. Seems to work?

Keychain item Access Control

I had a similar issue. Initially I was on a remote centos server trying to grab all remote svn branches to push them to a clean origin as true git branches for a hard cutover from svn to git via:

for remote in `git branch -r` ; do git checkout $remote; git pull; done

where there were ~240-ish remote branches. (There was no way I was going to put my password in for each of these pulls)

What I ended up doing was scp'ing the repo down to my local machine (a mac) and enabling keychain to handle the password caching. I pulled all the svn commits local and then copied my repo back to the remote machine.

On OSX, if you have used svn before, it looks like svn has created a password entry (in the OSX key ring app) that git svn cannot use nor create a new one. Symptom was that it asked each time, and SourceTree did not work with System git (nor did it with built-in git for another reason).

My solution was to delete this entry, and then use git svn once and it will create a proper entry. From that point, also SourceTree was working.

https://stackoverflow.com/a/55706141/580672

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top