Simple SVN Primer
From HotDec
Contents |
[edit]
Overview
When working on a project, a Subversion (SVN) repository will aid in tracking changes and coordinating among several contributors. Subversion allows a user to bring their copy of the project up to date with the main copy, view the history of changes, and add their contributions back into the main copy.
[edit]
Clients
- Windows: Tortoise SVN is an excellent user interface for subversion.
- Linux/Mac: The standard text-based client.
- Linux GUI: eSvn is a nice Linux graphical client.
[edit]
General Instructions
Suppose that there is a project that you would like to view and possibly make contributions to. You learn that the project's SVN repository is located at 'svn://some.machine/book'. Here are the steps you should follow:
- Create a directory for your project. This is called the 'working copy'.
- Copy the present state of the project to your working copy. This is 'svn checkout'.
- Whenever you have made useful changes, put those changes in the main copy. This is 'svn commit'.
- Bring other contributor's changes into your working copy daily. This is 'svn update'.
[edit]
Detailed instructions for TortoiseSVN / Windows
- Create a working-directory for your project
- Check-out the project to this directory.
- right click your folder
- select 'SVN Checkout'
- URL = "svn://some.machine/book"
- OK
- Update/Commit whenever the project is in a release-worthy state.
- right click the working-copy folder
- select "SVN Update"
- You may need to resolve conflicts if the Trunk has changed.
- select "SVN Commit"
- **enter a descriptive log message**
- OK
- Repeat Step 3.
[edit]
Detailed instructions for SVN commandline (Linux / Mac)
- Create a working-directory for your project. We'll use '~/book'.
- mkdir ~/book
- Check-out the project to this directory.
- svn co svn://some.machine/book ~/book
- (note that capitalization is important on Linux)
- ('co' is short for 'checkout')
- svn co svn://some.machine/book ~/book
- Update/Commit whenever the project is in a release-worthy state.
- svn up ~/book/
- ('up' is short for 'update')
- You may need to resolve conflicts if the Trunk has changed
- svn ci ~/book/ -m "<log-message>"
- ('ci' is short for 'commit')
- svn up ~/book/
- Repeat Step 3.
'
