Subversion: Difference between revisions

From miki
Jump to navigation Jump to search
Line 65: Line 65:
svn info /dir/file
svn info /dir/file
</source>
</source>

== HTTPS Client Certificates ==
References:
* [http://svn.cacert.org/CAcert/Sysadm/client-certificate-guide.pdf SVN Client Certificate Guide]
* [http://stylesen.org/subversion_client_authentication_using_pkcs_12_based_certificates_howto Subversion client authentication using PKCS#12 based certificates - howto]

Besides requiring a password, access to a svn repository through HTTPS may also require a client-side certificate. In that case, svn is smart enough to prompt for the location of the file containing the certificate and private key and for the password.

This can also be configured in the file <tt>~/.subversion/servers</tt>:

<source lang=bash>
[groups]
myserver = *.myserver.org

# This contains the settings for group "myserver".
# ! paths must be absolute !
# Client certificates are in format .p12 (same as .pfx), as generated by openssl pkcs12
[myserver]
#The file containing your client certificate
ssl-client-cert-file = /home/user/.subversion/clientcert.p12
#This gives a list of CA to use to authenticate the server certificate
ssl-authority-files = /absolute/path/to/cacert.pem,/absolute/path/to/root.pem

# Add the following to prevent SVN storing your passwords:
[auth]
store-passwords = no
store-auth-creds = no
</source>


'''Changing the client certificate password'''

See [[SSL]] for instructions on how to change the client certificate password.


== Examples ==
== Examples ==

Revision as of 22:01, 29 February 2012

References

Configuration

  • Colored diff — Either define colordiff as diff-cmd in ~/.subversion/config:
  • diff-cmd = colordiff
    

    However, to keep the internal svn diff tool, you need to define your own function & alias. This will also highlight diff header in green:

    function svnwrap()
    {
        if [ "$1" = "diff" ] ; then
    		"svn" "$@" | colordiff | less -FRX
    	else
    		"svn" "$@"
    	fi
    }
    alias svn=svnwrap
    

    To page the output, use | less -R

Workflows

Branch integration

From [1]:

  • Create a new branch off the trunk
  • Work on the branch
  • Merge (reintegrate) the branch into trunk
cd trunk
svn merge --reintegrate ^/branches/topic
svn commit
# Committed revision 555. 
# # this revision is ^^^^ important
  • From now on:
    • Either delete the branch
      svn delete ^/branches/topic
      
    • Or merge trunk back to the branch so that subsequent merges do not generate conflicts.
      This steps is necessary to tell svn that it should ignore the merged revision on the trunk at the next branch reintegration):
cd branches/topic
svn merge --record-only -c 555 ^trunk
svn commit

Commands

status (st)

Show modified/new/... files in the working copy.

svn status

propget (pg)

svn propget svn:mergeinfo

info

svn info .
svn info /dir/file

HTTPS Client Certificates

References:

Besides requiring a password, access to a svn repository through HTTPS may also require a client-side certificate. In that case, svn is smart enough to prompt for the location of the file containing the certificate and private key and for the password.

This can also be configured in the file ~/.subversion/servers:

[groups]
myserver = *.myserver.org

# This contains the settings for group "myserver". 
# ! paths must be absolute !
# Client certificates are in format .p12 (same as .pfx), as generated by openssl pkcs12
[myserver]
#The file containing your client certificate
ssl-client-cert-file = /home/user/.subversion/clientcert.p12
#This gives a list of CA to use to authenticate the server certificate
ssl-authority-files = /absolute/path/to/cacert.pem,/absolute/path/to/root.pem

# Add the following to prevent SVN storing your passwords:
[auth]
store-passwords = no
store-auth-creds = no


Changing the client certificate password

See SSL for instructions on how to change the client certificate password.

Examples

  • Checking out a project
svn co svn+ssh://ftp.noekeon.org/opt/www/daemenj/web/private/SVN/Keccak