SVN commands listicle

For everyone who have not yet transitioned to GIT from SVN I compiled my personal list that helps me with projects on which I need to use SVN versioning.


Creating a branch from trunk: 

svn cp trunk_URL branch_URL -m “Creating branch for …..”

SVN merging:

cd to branch (with your command console), then user svn merge command while you are in the directory of the branch:
  • svn merge trunk_URL
Basic commands:
  • svn status //tells differences between original and to be committed version
  • svn commit -m “Comment “ //normal commit for svn
  • svn ci -m “Fixed all those horrible crashes” foo bar baz graphics/logo.png   //commit only certain files
  • svn checkout https….branch_url
  • svn add —force .     //Adding files to svn versioning. Beacuse of . the ignore files are handled correctly. use * to override
  • svn status | grep “^\!” | sed ‘s/^\! *//g’ | xargs svn rm   //removes files that were manually removed and also everything flagged with ! so be careful
  • svn log -l 3    // get last 3 commits
  • svn log –verbose -r 26458 //details for revision 26458
  • svn rm // branch delete
  • svn log –limit 15 –verbose branch_or_trunk_URL //shows last 15 commits with which files were changed
  • svn merge –reintegrate branch_URL   trunk_URL //merging branch back to trunk
  • svn revert –depth=infinity . //reverting folder back to last commit
Special commands:
See the log for a certain time range

  • svn log –revision {2014-01-20}:{2014-01-30}

Cherry-picking a revision and merging to trunk

  • svn merge -c revisionNumber branch_URL

Command used for resolving tree conflicts (There are always some :p )

  • svn resolve –accept working -R <path>
By |September 21st, 2014|Categories: ALL|

About the Author:

Senior lead developer currently working in Java, architecture design, mix of tech from Front-end in JS and templating to chef,rundeck etc. For fun and challenge I am writing different blog posts from stories to poems, programming tutorials and many more. Currently working on my Masters degree on a part-time basis.