You can specify credentials to log in to a Subversion repository in the following settings:
|
SubGit refers to these settings in the sequence presented below. If some setting is not specified or the credentials fetched from the setting are not valid, SubGit refers to the next one until it is able to log in to a Subversion repository.
- The
userName
andpassword
settings. - The
passwords
setting that refers to the passwords file for a username-password pair. - A credential helper program.
- Subversion credentials cache from the Subversion client configuration directory.
If none of the settings is specified or fetched credentials are not valid, SubGit reports the authentication error.
The userName and password settings
The password is stored as plain text. For security reason, it is recommended to limit the access to the SubGit configuration file.userName
and password
settings specify a username and a password to access a Subversion repository.
The passwords setting
The default value: The default password file is located in the subgit directory within a Git repository. In this file, you can specify the list of username-password pairs as plain text in the following format: The credentials from the passwords file may be used for mapping Git authors to Subversion revision authors when you translate Git commits to Subversion revisions. For the mapping purpose, you can specify the list of available usernames and passwords in the passwords file, though it is not obligatory. For more information on authors mapping, refer to the Authors Mapping section. When you have several Git repositories mapped from the same Subversion repository, you can log in to this Subversion repository using a single passwords file.passwords
setting defines a path to the passwords file that can contain the list of username-password pairs to log in to a Subversion repository. The path can be either absolute or relative to the Git repository.[auth
"default"
]
passwords = subgit/passwd
svnUserName svnUserPassword
Using credential helper programs
To enable a credential helper program, specify the following setting: The The initial SubGit configuration places the sample credential helper script (the The initial script contains the following: You can configure this script to fetch the credentials from some external source to log in to a Subversion repository. Use the standard Git credential helper input/output format with the exception that the command name is not required. Input: Output:[auth
"default"
]
credentialHelper = PATH [args]
credentialHelper
setting defines a path to a credential helper program and its optional arguments. The path can be either absolute or relative to the Git repository.credentialHelper.sh
file) to the subgit/samples
directory in the Git repository.#!/bin/sh
echo username=svnUser
echo password=svnPassword
exit
0
;
url = SVN_URL
protocol = SVN_URL_PROTOCOL
path = SVN_URL_PATH
username = PREFFERED_SVN_USER_NAME
username = SVN_USER_NAME
password = SVN_PASSWORD
Using the Subversion credentials cache
To enable the authentication with Subversion credentials cache, specify the following settings: The The 1st setting takes priority over the 2nd. If the path to the appropriate Subversion directory with caсhed credentials is specified, SubGit refers to it and ignores the default Subversion configuration directory. Subversion clients store encrypted passwords in the The Subversion authentication realm and usernames are stored in the By default, Subversion clients ask permission to store unencrypted passwords in the Currently, SubGit supports only GNOME Keyring. The example below shows how to use the Subversion credentials cache with encrypted passwords on Linux. Example: Use of credentials cache with encrypted passwords on Linux All the passwords stores are disabled in the Subversion configuration file: To enable a password store, in the Subversion configuration file, uncomment a password-stores line and specify the store that you want to enable. Currently, SubGit supports only GNOME Keyring. For example, In a Subversion client, run any command that prompts for the credentials to a Subversion server, for example, SubGit can use the credentials cache from this directory to log in to a Subversion repository.[auth
"default"
]
subversionConfigurationDirectory = PATH
useDefaultSubversionConfigurationDirectory = [
true
|
false
]
The subversionConfigurationDirectory
setting defines a path to a Subversion directory that stores credentials' cache.useDefaultSubversionConfigurationDirectory
setting specifies whether SubGit will use the default Subversion configuration directory to obtain the authentication data or not.
The location of the default Subversion configuration directory and the way the credentials cache is stored in it depend on the operating system that you use. The usual configuration is the following:%APPDATA%\Subversion\auth\svn.simple
directory. Passwords are encrypted by the standard Windows cryptographic services.~/.subversion/auth/svn.simple
directory. The encrypted passwords are stored in macOS Keychain.~/.subversion/auth/svn.simpl
e directory. The secure storage can be provided by the GNOME Keyring, KDE Wallet or GnuPG Agent services.[auth]
### Set password stores used by Subversion. They should be
### delimited by spaces or commas. The order of values determines
### the order in which password stores are used.
### Valid password stores:
### gnome-keyring (Unix-like systems)
### kwallet (Unix-like systems)
### gpg-agent (Unix-like systems)
### keychain (Mac OS X)
### windows-cryptoapi (Windows)
# password-stores = gpg-agent,gnome-keyring,kwallet
### To disable all password stores, use an empty list:
# password-stores =
password-stores = gnome-keyring
svn info url
. After that the credentials cache is stored in a text file in the ~/.subversion/auth/svn.simple
directory. The encrypted password is stored in GNOME keyring.