Using SVNOn 6 November 2010 in Tech
My notes on how to use subversion from command line.
Project dir: ~/Projects/myproj
SVN temp layout dir: /tmp/svn
SVN repos: /var/svn/repos
mkdir -p /var/svn/repos svnadmin create --fs-type fsfs /var/svn/repos/myproj
svn import <local dir> <repo> mkdir -p /tmp/svn/trunk /tmp/svn/tags /tmp/svn/branches svn import /tmp/svn file:///var/svn/repos/myproj -m "Initial import" svn import ~/Projects/myproj file:///var/svn/repos/myproj/trunk -m "Initial project import"
for local repo – file:/// …
for network repo – http:// …
svn checkout|co <repo> [working copy] svn checkout file:///var/svn/repos/myproj ~/Projects/myproj svn co file:///var/svn/repos/myproj/trunk # will auto checkout to folder 'myproj' in current dir # that folder is called 'working copy' dir
svn status # in working copy dir
svn add <folder|file>
svn delete <folder|file> svn delete file:///var/svn/repos/myproj/trunk/file.txt # also can delete file in repo, not only in working copy
svn commit -m "Log message" # in working copy dir
svn update (in working copy dir)
svn copy <repo> <repo tag dir> svn copy file:///var/svn/repos/myproj/trunk file:///var/svn/repos/myproj/tags/0.1 -m "Version 0.1"
Export (for release)
svn export <repo> svn export file:///var/svn/repos/myproj/tags/0.1 # will export to folder 'myproj' in current dir