Common SVN Commands

Kevin FOO
1 min readOct 14, 2021

These are the few SVN commands I use regularly.

Check out

svn checkout http://<url_or_ip>/svn/project

To check out using a different username

svn checkout http://<url_or_ip>/svn/project --username <different_username>

Once you successfully checkout, your credentials will be saved at

~/.subversion/

To clear the saved credentials, run

rm -rf ~/.subversion/

To update local codes to the latest revision, from example above, go into “project” directory and run

svn update

To update local codes to revision number 88

svn update --revision 88

To add a file “readme.txt” into the repository

svn add readme.txt

To rename a file, lets say I’m renaming “readme.txt” to “to_delete.txt”

svn move readme.txt to_delete.txt

To delete a file “to_delete.txt” from the repository

svn delete to_delete.txt

To undo all local changes

svn revert --recursive .

To commit changes

svn commit --message 'your_commit_message_here'

To rollback changes, lets say latest revision is 123 and we are rolling back to revision 118. Still within the “project” repository, run the commands below

svn update
svn merge --revision 123:118 .
svn commit --message 'rolled back to revision 118'

View all the files changed in revision 88

svn log --verbose --revision 88

View your repository in a web browser

http://<ip_or_domain>/svn/project/

View your repository in a web browser at revision 88. Just append “?p=88”

http://<ip_or_domain>/svn/project/?p=88

View file “readme.txt” in a web browser at revision 88.

http://<ip_or_domain>/svn/project/readme.txt?p=88

< Back to all the stories I had written

--

--

Kevin FOO

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.