SVN

From Supernifty
Jump to: navigation, search

Admin

Adding a user

  • htpasswd -m auth_file username

Tagging a version

  • Use SVN copy
svn copy http://www.sample.com/svn/trunk/ http://www.sample.com/svn/tags/version_x.xx/ -m "tagging release x.xx"

Branching and merging

  • Create branch with svn copy
svn copy http://www.sample.com/svn/trunk/ http://www.sample.com/svn/branches/issue_bbb/ -m "branch for issue bbb"
  • Either checkout the branch or switch to it
svn checkout http://www.sample.com/svn/branches/issue_bbb/
cd trunk-directory
svn switch http://www.sample.com/svn/branches/issue_bbb/
  • Make changes, commit, etc
  • Merge branch back to trunk

Find the revision when the branch was created

svn log --verbose --stop-on-copy http://www.sample.com/svn/branches/issue_bbb/

Get the revision number nnn to use below

Merge to trunk

cd trunk-directory
svn update

Note the trunk revision mmm

svn merge -r nnn:HEAD http://www.sample.com/svn/branches/issue_bbb/ # merges changes made to branch from nnn to head, to cwd
svn status # see what happened

Check that everything worked.

svn commit -m "Merged issue bbb rnnn:mmm into trunk"

Done!

Merging further changes

If further changes are made on the branch that need to be merged, you need that revision mmm from before.

cd trunk-directory
svn log # to get mmm
svn update
svn merge -r mmm:HEAD http://www.sample.com/svn/branches/issue_bbb/

Switching to the branch

To turn the working copy into the branch

cd trunk-directory
svn switch http://www.sample.com/svn/branches/issue_bbb/

To merge trunk changes into branch

What revision created the branch?

svn log --verbose --stop-on-copy http://www.sample.com/svn/branches/issue_bbb/
cd branch-directory
svn merge -r nnn:HEAD http://www.sample.com/svn/trunk/