Source Code Revision Control With Subversion
Source Code Revision Control With Subversion
Christophe Dupré
May 13, 2005
Update KEJ May 10, 2006
Setting a property
$ svn propset svn:eol-style native README.txt
Dealing with binary files
Subversion is optimized for dealing with text
files (source code, LaTeX documents, etc)
But, it can deal with binary files
– Will not diff nor merge
– Will not change EOL nor apply keywords
SVN has a binary detection algorithm, but it
sometimes fails (PDF have a text header)
– Need to set svn:mime-type property manually to
application/octet-stream
Repository Organization
Per-project
directories
Three subdirectories per project:
– trunk, tags, branches
Trunk is for main development
Tags is for read-only snapshots
Branches is a work area
Working with Branches
Create a new branch (NOTE. Replace TEST
by the module that you want to work with)
$ svn cp https://gforge.scorec.rpi.edu/svn/TEST/trunk \
> https://gforge.scorec.rpi.edu/svn/TEST/branches/duprec-work
Commited revision 6
$ svn co https://gforge.scorec.rpi.edu/svn/TEST/branches/duprec-work
Make Changes...
Merge trunk changes into branch
$ svn merge -r 6:HEAD \
> https://gforge.scorec.rpi.edu/svn/TEST/trunk .
Testmerged branch
Merge branch into trunk
$ cd trunk
$ svn merge -r 6:HEAD \
> https://gforge.scorec.rpi.edu/svn/TEST/branches/duprec-work .
Best Practices
Commit early, commit often
Commit logical changesets
Track merges manually
– When committing the result of a merge, write a
descriptive log
Merged revisions 3490:4120 of /branches/foobranch to /trunk