Git-svn: how to change svn username to dcommit?

I cloned the SVN repository to the git repository using git svn clone . At this point, I did not have a username on this site and therefore did not use the --username clone parameter. Since I can now commit the SVN repository with my new username, I would like to add this username. Without it, dcommit simply fails:

 % LANG=C git svn dcommit Committing to <THE URL> ... RA layer request failed: Server sent unexpected return value (405 Method Not Allowed) in response to MKACTIVITY request for '/svn/!svn/act/0ceca4c5-f7b4-4432-94be-0485559a6040' at /usr/lib/git-core/git-svn line 945. 

Is there a way to tell git about a new username? git-svn manual doesn't seem to help: adding a username is only allowed on init and branch . I don't know how git works with SVN internally, but I guess there should be a way after that to add a username.

Please note that I use SVN via http.

+4
source share
2 answers

I think you can use this procedure (from the git svn manpage) to create a clone of the existing svn repository, but change the git svn init step so that it defines the username. Your new git-svn repository will have a username.

 # Clone locally - make sure the refs/remotes/ space matches the server mkdir project cd project git init git remote add origin server:/pub/project git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*' git fetch # Prevent fetch/pull from remote git server in the future, # we only want to use git svn for future updates git config --remove-section remote.origin # Create a local branch from one of the branches just fetched git checkout -b master FETCH_HEAD # Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server) git svn init --username my_new_name http://svn.example.com/project # Pull the latest changes from Subversion git svn rebase 
0
source

Please note that if you provide a username, you will not be able to commit commit, and not until Git 2.16.x / 2.17 (Q1 2018).
This is because " git svn dcommit " does not take into account the fact that svn+ssh:// URL with username@ (usually used to click) to the same SVN repository without username@ and failed when svn.pushmergeinfo .

See commit 8aaed89 (September 15, 2017) by Jason Merrill ( jwmerrill ) .
(merging Jason Merrill - jwmerrill - on commit 8aaed89 , 17 Sep 2017)

git-svn : fix svn.pushmergeinfo handling svn+ssh usernames.

Formerly svn dcommit merges with the svn.pushmergeinfo set to receive error messages, for example

 merge parent <X> for <Y> is on branch svn+ssh://gcc.gnu.org/svn/gcc/trunk, which is not under the git-svn root svn+ssh:// jason@gcc.gnu.org /svn/gcc!" 

So, call remove_username (as for svn info ) before comparing rooturl to branchurl .

0
source

All Articles