I found a lot of examples on how to change the username for specific revisions and so on.
But what I need is this: I did a checkout with the authentication credentia
You could ask your colleague to create a patch, which will collapse all the changes that have been made into a single file that you can apply to your own check out. This will update all of your files appropriately and then you can revert the changes on his side and check yours in.
The easiest way to do this is to simply use the --username option on your next checkout or commit. For example:
svn commit --username newUser
or
svn co --username newUser
It will then be cached and will be used as the default username for future commands.
See also: In Subversion can I be a user other than my login name?
You can change the user with
Subversion 1.6 and earlier:
svn switch --relocate protocol://currentUser@server/path protocol://newUser@server/path
Subversion 1.7 and later:
svn relocate protocol://currentUser@server/path protocol://newUser@server/path
To find out what protocol://currentUser@server/path
is, run
svn info
in your working copy.
I’ve had the exact same problem and found the solution in Where does SVN client store user authentication data?:
cd
to ~/.subversion/auth/
.fgrep -l <yourworkmatesusernameORtheserverurl> */*
.(For Windows, the steps are analogous; the auth
directory is in %APPDATA%\Subversion\
).
Note that this will only work for SVN access schemes where the user name is part of the server login so it’s no use for repositories accessed using file://
.
Based on Ingo Kegel's solution I created a "small" bash script to change the username in all subfolders. Remember to:
<NEW_USERNAME>
to the new username.<OLD_USERNAME>
to the current username (if you currently have no username set, simply remove <OLD_USERNAME>@
).In the code below the svn command is only printed out (not executed). To have the svn command executed, simply remove the echo
and whitespace in front of it (just above popd
).
for d in */ ; \
do echo $d ; pushd $d ; \
url=$(svn info | grep "URL: svn") ; \
url=$(echo ${url#"URL: "}) ; \
newurl=$(echo $url | sed "s/svn+ssh:\/\/<OLD_USERNAME>@/svn+ssh:\/\/<NEW_USERNAME>@/") ; \
echo "Old url: "$url ; echo "New url: "$newurl ; \
echo svn relocate $url $newurl ; \
popd ; \
done
Hope you find it useful!