Home Blog Subversion notes
Subversion notes

Subversions basics, from the book: Version Control with Subversion

Svn file status:

  • Unchanged, and current (identical to file in svn repository)
  • Locally changed, and current( changed in working copy, but not committed)
  • Unchanged, and out-of-date (changed in repository)
  • Locally changed, and out-of-date (changed in working copy and in the repository. "svn update" will do a merge. if this does not result in a conflict, a commit is possible. If not, the problem has to be resolved by hand).

show status AND revisions of all files<\p>

svn status --verbose

create a repository:

svnadmin create /home/jaap/Desktop/Projects/subversion/newrepos

fill repository with initial data:

svn import mytree file:///home/jaap/Desktop/Projects/subversion/newrepos/some/project \
-m "Initial data"

list contents:

svn list file:///home/jaap/Desktop/Projects/subversion/newrepos/some/project

download an existing repository:

svn checkout file:///usr/local/subversion/tuxadmin/trunk/


While Subversion's flexibility allows you to layout your repository in any way that you choose, we recommend that you create a trunk directory to hold the “main line” of development, a branches directory to contain branch copies, and a tags directory to contain tag copies, for example:


$ svn list file:///usr/local/svn/repos
/trunk
/branches
/tags

Common commands:

svn update # update your working copy
svn add # add a file/dir
svn delete # delete
svn copy # copy something
svn move # move/rename something
svn mkdir # make a directory
svn status # examine your status
svn diff # show differences
svn revert # possibly undo some changes
svn resolved # merge other's changes
svn commit # commit changes