Confirmed users, Bureaucrats and Sysops emeriti
1,737
edits
m (→How to get an account: Form link) |
m (→How to Use SVN) |
||
| Line 46: | Line 46: | ||
= How to Use SVN = | = How to Use SVN = | ||
Subversion is designed so that a conversion from CVS is as painless as possible. This is a short introduction to some basic commands - please read the "Notes" section below for more useful links. | |||
===checkout (co)=== | |||
([http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.checkout.html documentation]) | |||
'''Usage: svn co <source> <dest>''' | |||
SVN bases it's repositories on URLs, so to check out code, you'll need a URL. For example, to checkout the code for mozilla.com anonymously you could type: | |||
''svn co http://svn.mozilla.org/projects/mozilla.com/trunk/ mozilla.com/'' | |||
or if you have an account: | |||
''svn co svn+ssh://svn.mozilla.org/projects/mozilla.com/trunk/ mozilla.com/'' | |||
By checking out over ssh, you'll be able to commit your changes. | |||
===commit (ci)=== | |||
([http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.commit.html documentation]) | |||
'''Usage: svn commit [file [file...]]''' | |||
Once your code is checked out, you can commit your changes back to the repository. This command takes an optional list of files or directories to commit, if you only want to commit some changes. An example: | |||
''svn commit'' | |||
If you'd like to add a comment and commit all in one line, you can try this command: | |||
''svn commit -m "Commit message here"'' | |||
===status=== | |||
([http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.status.html documentation]) | |||
'''Usage: svn status [file [file...]]''' | |||
Regarding commands, this is one of the largest differences from CVS. Instead of | |||
having to update your tree to check the status of files, SVN has this command which will list the differences without affecting your files. See the | |||
[http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.status.html status documentation] | |||
page for what the letters mean. | |||
''svn status'' | |||
===update=== | |||
([http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.update.html documentation]) | |||
'''Usage: svn update [file [file...]]''' | |||
This will pull any new changes from the repository and merge them into your local files. | |||
''svn update'' | |||
== Notes == | |||
This is a really brief overview, and if you'd like further reading, please check out the following: | |||
* [http://svnbook.red-bean.com/en/1.2/index.html The complete free O'reilly book] (filled with great examples) | |||
* [http://svnbook.red-bean.com/en/1.2/svn.forcvs.html A short appendix] from the book specifically for CVS users | |||
* [http://www.onlamp.com/pub/a/onlamp/2004/08/19/subversiontips.html ONLamp.com's top tips] for CVS users | |||