How do I change the default author for accessing a local SVN repository?

后端 未结 5 2171
自闭症患者
自闭症患者 2020-12-19 01:32

I use TortoiseSVN to access file based local repo. In all my commits an author is my Windows login name. Is it possible to use different name?

I know how to change a

相关标签:
5条回答
  • Another possible workaround (but I am NOT advocating it) is to use a client-side hook script before commit, in order to change the username.

    Hook scripts are discussed in the Subversion book, and local hooks are discussed in "Client Side Hook Scripts" in TortoiseSVN help.

    0 讨论(0)
  • 2020-12-19 01:57

    I've never hosted svn on a Windows machine, so this is a shot in the dark. You might be able to create a new Windows user and specify that user when browsing, checking out, committing, etc. Let's say you want to make changes as msznajder. Create a user with that name in Windows, then try browsing the repository using TortoiseSVN's Repo-browser and specify the username in the URL - something like file:///msznajder@localhost/some/file/path.

    0 讨论(0)
  • 2020-12-19 02:06

    Yes, it's possible.

    TortoiseSVN and the svn command line client share the same settings location in your profile folder. So you may simply checkout one version using svn.exe:

    $ svn co --username different_user_name file:///C:/path/to/your/repo
    

    ... and Subversion will happily replace the associated username for that repository. New commits from TortoiseSVN will then always use that username, no matter with what program you make the new checkouts.

    The procedure should work with TortoiseSVN 1.5.5. If it doesn't, try emptying svn's authentication cache (%APPDATA%\Subversion\auth\svn.username) first.

    0 讨论(0)
  • 2020-12-19 02:08

    I suggest setting a post-commit-hook (in your repo's hooks folder - just copy the post-commit-hook.tmpl to post-commit-hook.bat and empty it [1]

    svn propset svn:author --revprop -r HEAD <author> file:///<path-to-repo> [2]

    [1] provided SlikSvn or similar is installed, i.e. commandline svn access is possible)

    [2] (or .sh if on linux, with the #!/bin/bash preamble) with the same content

    0 讨论(0)
  • 2020-12-19 02:16

    As far as I know, TortoiseSVN does not offer any way to do this.

    Presumably it's not seen as a big issue, since file based access is not practical for multi-user scenarios, and for single-user the author-name is of lesser importance.

    A possible workaround would be to create another Windows username with the author name you want and connect with this.

    0 讨论(0)
提交回复
热议问题