svn usage


SVN usage


Import a new project

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

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

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)

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

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

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
$ svn merge https://svn/url/trunk .
$ svn ci -m "updated branchname with trunk"

Reintegrate branch to trunk (subversion >= 1.5):

$ pwd
$ 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 \
      -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