lost baby
lost baby

Reputation: 3268

How to commit to svn when remote username differs from local?

I am developing on a mac and using an svn server on another machine using svn_ssh.
While I was able to do an initial check-in and check-out, I cannot do a commit from the command line because the system tries to use my local username jondoe (and prompts a password) when connecting to the remote server where my username is johnd.

So, how can I tell the svn+ssh to use johnd for my commits?

Upvotes: 13

Views: 40659

Answers (3)

Míla Mrvík
Míla Mrvík

Reputation: 535

  1. Backup your changes (just changed files, you mustn't overwrite .svn directory)
  2. Checkout again, but now using your remote username

    svn checkout svn+ssh://<ssh_username>@<svn host domain>/<server repository path>
    
  3. Restore your changes from backup

  4. Commit them

    svn commit -m 'Description'
    

I've just successfuly checked out and committed with different local and SSH usernames.

Upvotes: 6

dave4420
dave4420

Reputation: 47062

In your ~/.ssh/config, add a section like this:

Host svn.example.com
User johnd

Replace svn.example.com with the hostname of the svn server.

This will work for all ssh connections, not just subversion-related ones.

See also the manual page ssh_config, which you may be able to read by running man ssh_config in a shell.

Upvotes: 3

ks1322
ks1322

Reputation: 35845

Use --username option

svn commit --username johnd

Upvotes: 44

Related Questions