svn usage

Information

SVN usage

Procedure

Import a new project

http://svnbook.red-bean.com/nightly/en/svn.tour.importing.html

You should create a basic template for the project (let's call our project “project”):

$ mkdir -p project/trunk project/tags project/branches

You want to put your first version into project/trunk

$ svn import project https://shalom/svn/web/project -m "initial import"

Initial Checkout

http://svnbook.red-bean.com/nightly/en/svn.tour.initial.html

The first time you checkout a project, run:

$ svn checkout https://shalom/svn/web/project/trunk destdir

destdir will be a local folder containing all the files in the project/trunk directory

Update your working copy

http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.update

This command will download all changes since the last time you updated or initially checked out the files:

$ svn update

I think it might try to merge any local changes you have made to the files with what is downloaded from the server.

View changes (diff)

http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.examine

If you want to see what changes you have made to your local working copy (as compared to the copy you most recently downloaded), run:

$ svn diff

Undoing (reverting) changes

http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.revert

If you made a change to your local working copy that you did not like, run:

$ svn revert FILE_TO_REVERT

Add a new file

To add a new file, run:

$ svn add NEWFILE

(the adding will not actually take place until you commit your changes).

Resolve conflicts

Commit your changes

http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.commit

When you are done editing your local copies, it is time to commit them to the SVN repository:

$ svn commit -m "fixed navbar navigation"

The log message (-m …) is required when committing - it gives a brief summary of the changes you have made to your local working copy.

Working with branches

basic merging info

branch switching

Create a branch:

$ svn copy https://svn/url/trunk https://svn/url/branches/branchname -m "creating branch branchname"

Update the branch (to keep in sync with trunk):

$ pwd
/path/to/branch/workingcopy
$ svn merge https://svn/url/trunk .
$ svn ci -m "updated branchname with trunk"

Reintegrate branch to trunk (subversion >= 1.5):

$ pwd
/path/to/trunk/workingcopy
$ svn merge --reintegrate https://svn/url/branaches/branchname .
$ svn ci -m "merged branchname into trunk"

After reintegrating, you must delete the branch as it is no longer useful.

svn delete http://svn.example.com/repos/calc/branches/my-calc-branch \
      -m "Remove my-calc-branch."

You can switch branches with:

$ svn switch https://svn/url/newpath
freebsd/svn_usage.txt · Last modified: 2009/03/29 19:54 by john
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki