Working with subversion (SVN)

#svn+ssh url examples:
svn+ssh://ssh-user@your-remote-svn-server-ip/os-path-to-svn-repository/project-name
svn+ssh://root@adrhc.go.ro/i-data/SVN-Repository/image-processor
svn+ssh://root@adrhc.go.ro/i-data/SVN-Repository/image-processor/trunk

#starting svn server
#path-to-svn-repository: the value for -r svnserve's option
svnserve -d -r path-to-svn-repository --log-file /ffp/log/svnserve.log

#ssh-user will also be used as the Author when commiting to SVN
#You'll have to use Putty pageant for authentication or
#you'll be asked for password many times (for any ssh connections).

#Host env var in order for Intellij IDEA to work with svn+ssh approach:
set SVN_SSH="C:\\Program Files (x86)\\PuTTY\\plink.exe"

#checkout to project-name directory (automatically created)
svn co svn://localhost/project-name

#list changes and new files
svn status

#list unversioned files
svn status | grep ^?

#list changed files
svn status | grep ^M

#add the patterns from .gitignore file to the svn ignore list for the current directory
svn propset svn:ignore -F .gitignore .
svn propedit svn:ignore . -> edit current ignore list
svn propget svn:ignore

# create then checkout "springboot" repository:
cd ~/SVNRepoUbuntu
svnadmin create springboot
cd ~/Projects
svn co file:///********/SVNRepoUbuntu/springboot

# add recursively to svn
cd ~/Projects/springboot
svn add --force --auto-props --parents --depth infinity -q .
svn status .

# see http://superchlorine.com/2013/08/getting-svn-to-ignore-files-and-directories/
# ignore *.class *.apk and Thumbs.db in current dir
svn propset svn:ignore -R "*.class 
> *.apk 
> Thumbs.db" .
The > is, of course, just my shell prompts. You don’t type those in.
svn status --no-ignore

# format xml
xmlstarlet format --indent-tab pom.xml > pom.xml1 && rm pom.xml && mv pom.xml1 pom.xml

#ERROR
    svn commit sqlite attempt to write a readonly database
#SOLUTION
    Make writable the rep-cache.db file from your svn-repository.

# login with p12 file and cache user/password:
# /****************/.subversion/servers
[global]
store-passwords = yes
store-ssl-client-cert-pp = yes
store-plaintext-passwords = yes
store-ssl-client-cert-pp-plaintext = yes
store-auth-creds = yes
ssl-trust-default-ca = yes
ssl-client-cert-file = /****************/SVNclient.p12
ssl-client-cert-password = SVNclient.p12-password-here

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.