SVN

Helpful Links

 * http://wiki.greenstone.org/wiki/index.php/Useful_SVN_Commands
 * http://www.abbeyworkshop.com/howto/misc/svn01/
 * http://svnbook.red-bean.com/en/1.5/svn.tour.history.html#svn.tour.history.log
 * http://www.digitalmediaminute.com/article/2251/how-to-move-a-subversion-repository
 * http://stackoverflow.com/questions/1768691/subclipse-override-and-commit
 * Mark as Merged
 * http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-merge.html

Branching
$ cd bigwc $ svn copy trunk branches/my-calc-branch $ svn status A +   branches/my-calc-branch
 * http://svnbook.red-bean.com/en/1.1/ch04s02.html#svn-ch-4-sect-2.1
 * http://svnbook.red-bean.com/en/1.5/svn.branchmerge.html

Externals

 * http://beerpla.net/2009/06/20/how-to-properly-set-svn-svnexternals-property-in-svn-command-line/

Initial Import
Directory tree that you are importing MUST contain trunk, tags and branches if you want those LocalDirectory |- README:placeholder |- README:placeholder |-README:placeholder |-src svn --username yourName import -m "Initial import" LocalDirectory http://remote.hostname.com/svn/Module/Project svn co http://remote.hostname.com/svn/Module/Project/trunk Project
 * -branches
 * -tags
 * -trunk

Delete
svn delete PATH... svn delete URL "Items specified by PATH are scheduled for deletion upon the next commit &hellip; Items specified by URL are deleted from the repository via an immediate commit."
 * http://svnbook.red-bean.com/en/1.1/re08.html

Restoring
svn log --verbose svn up -r 250 file.txt svn copy -r 411 http://svn.scm.example.com/repository/trunk/doc/text/file.txt file.txt svn up -r $OLD file.txt emacs file.txt & svn revert file.txt // haven't committed? svn revert foo.txt
 * http://m0j0.wordpress.com/2007/10/25/recovering-deleted-files-from-an-svn-repository/
 * http://www.xenoveritas.org/node/331
 * http://stackoverflow.com/questions/497670/whats-a-simple-way-to-undelete-a-file-in-subversion

// committed? assuming the current version is 123 and the last version with file is 120 svn log --verbose -r 120 svn --dry-run merge -r123:120 svn merge -r123:120

// remove it but keep a copy svn rm foo.txt --keep-local //cd to the directory that is missing the file // use the '@' sign to indicate with revision you want back svn cp http://user@my.svnrepo.com/Project/trunk/Classes/Managers/User.m@10 User.m

svn:keywords
"Subversion will never attempt to perform textual substitutions on your file contents unless explicitly asked to do so. To tell Subversion whether or not to substitute keywords on a particular file, we again turn to the property-related subcommands. The svn:keywords property, when set on a versioned file, controls which keywords will be substituted on that file. The value is a space-delimited list of the keyword names or aliases found in the previous table."
 * http://svnbook.red-bean.com/en/1.1/ch07s02.html

$ svn propset svn:keywords "Date Author" weather.txt property 'svn:keywords' set on 'weather.txt'

svn:ignore
You set the ignore files on a directory by directory basis (that seems stupid, means you have to put these everywhere you want files ignored). Here is an example ignoring the build directory (in the root) and pbxuser and mode1v3 files in a child directory. You may use propset if there is only one entry, otherwise, you must use propedit and put each expression on a different line: $ export VISUAL=vi $ svn propset svn:ignore build. $ svn propedit svn:ignore Project.xcodeproj
 * http://www.petefreitag.com/item/662.cfm
 * http://svnbook.red-bean.com/en/1.1/ch07s02.html
 * .pbxuser
 * .mode1v3
 * x

$ svn status You should notice then that the files matching what you ignored are missing from svn status. Note that this will not remove files that already exist in SVN. Important to mention: On the Commandline you can't use svn add * this will also add the ignored files, because the Commandline expands * and though, each file is given on the Commandline. svn add believes that you would explicitly add those file. Therefore use svn add --force.
 * http://stackoverflow.com/questions/116074/how-to-ignore-a-directory-with-svn

Username
svn --username list https://svn.hostname.com/repo/module/


 * https://www.forge.funambol.org/scdocs/ddUsingSVN_command-line
 * http://stackoverflow.com/questions/405690/in-subversion-can-i-be-a-user-other-than-my-login-name

Tips
How do I add a new folder to an existing repository without pulling the repo down? Note that this technique will not actually commit the listed dir1 and dir2. Instead, it commits anything underneath them. This is tricky when it comes to naming. Also, consider if you to add trunk, tags or branches directories to your import. svn import dir1/dir2 https://svn.host.com/repository/module

How to cat a file without necessarily pulling it down?
 * svn cat -r459 https://svn ....

How to keep svn from updating a directory already in repository alias myup='ls | args svn up; svn up -N'
 * http://stackoverflow.com/questions/508135/how-to-keep-svn-from-updating-a-directory-already-in-repository

Moving things directly in SVN: svn mv https://svn.host.com/repository/module/oldname https://svn.host.com/repository/module/newname
 * http://stackoverflow.com/questions/1013034/svn-change-directory-structure-on-an-existing-repository