Subversion

From Nuclear Physics Group Documentation Pages
Revision as of 02:45, 21 February 2010 by Tbow (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Create an empty directory first and specify it (/net/home/Tbow/svn)

svnadmin create --fs-type fsfs svn/

To import a directory into svn database

svn import Example file
///net/home/Tbow/svn/example -m "Example code"

Used to checkout an already imported directory and the example directory doesn't have to be in the svn directory in order to bring it down to a working dir (./)

svn checkout file
///net/home/Tbow/svn/example/ ./
svn checkout -r 1 file
///net/home/Tbow/svn/example/ ./

You must use this command to delete the files and then commit, otherwise just removing the files (rm) will not be enough for this change to be committed.

svn delete *.class

To add new files to be commited use this command

svn add exam.java
svn commit * -m "Just before cleanup of code"

This will update your current working directory from the database.

svn update

This will list all the subdirectories you imported above.

svn list file
///net/home/Tbow/svn/

This will list all the revision numbers associated with this directory in the db.

svn log file
///net/home/Tbow/svn/example/


The typical work cycle looks like this
1. Update your working copy.
svnupdate
2. Make changes.
svnadd
svndelete
svncopy
svnmove
3. Examine your changes.
svnstatus
svndiff
4. Possibly undo some changes.
svnrevert
5. Resolve conflicts (merge others' changes).
svnupdate
svnresolve
6. Commit your changes.
svncommit