Tags:
view all tags
---+ Subversion -- Basic Use (For additional info, see [[http://svnbook.red-bean.com/nightly/en/svn.tour.html][Chapter 2 of the Subversion book]].) ---++ Initial import Initial import is done with the =svn import= command. It takes two arguments -- a source directory, and a destination URL. You can also supply a log message with =-m=. The message is mandatory -- if you don't provide one, your default editor will be started so you can compose one. <verbatim> $ svn import svn-demo svn://lemur.ling.washington.edu/test/svn-demo/trunk -m "Initial import of sample Subversion project." Adding svn-demo/party Adding svn-demo/party/potluck.txt Adding svn-demo/party/pizza-toppings.txt Committed revision 198. </verbatim> ---++ Checking out a working copy Importing a directory does not automatically make it a working copy under version control. To do that, it's necessary to check it out, just like you would with someone else's project. <verbatim> $ svn checkout svn://lemur.ling.washington.edu/test/svn-demo/trunk A trunk/party A trunk/party/potluck.txt A trunk/party/pizza-toppings.txt Checked out revision 198. </verbatim> ---++ Basic workflow Once you've got a project under version control, day-to-day use follows a simple pattern. ---+++ 1. Make sure you're up to date. This can be skipped if you're working on your own private project. If you're collaborating with others, however, it's best to make sure you have the most recent revision before you start editing files. <verbatim> $ svn update At revision 198. </verbatim> ---+++ 2. Make your changes. Edit files as you normally would. ---+++ 3. View the status of your files, and fix any problems. To see what changes you've made, you can use =svn status=. <verbatim> $ svn status ? location.txt M potluck.txt </verbatim> The question mark means there's a new file that Subversion doesn't know about yet. That can be fixed with =svn add=. <verbatim> $ svn add location.txt A location.txt </verbatim> If you're working on textual files (such as text or source code) you can also view the specific changes to a particular file. <verbatim> $ svn diff potluck.txt Index: potluck.txt =================================================================== --- potluck.txt (revision 198) +++ potluck.txt (working copy) @@ -3,3 +3,4 @@ Alice - Salad Earl - Scalloped potatoes Sue - Jell-O +David - Chocolate cherry cake </verbatim> ---+++ 4. Commit the changes. =svn commit= requires a log message, just like =svn import= does. <verbatim> $ svn commit -m "potluck.txt: Add another dish to pass; location.txt: Add new file for party location." Adding party/location.txt Sending party/potluck.txt Transmitting file data .. Committed revision 199. </verbatim> *Note:* Revision numbers will not always be consecutive. They're global for the entire repository, so commits to other projects will increment the version number you see. -- Main.DavidBrodbeck - 25 Oct 2007
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r2 - 2007-10-30
-
DavidBrodbeck
Home
Site map
Main web
Sandbox web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Edit
Attach
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback