Subversion is a revision control system distributed under an open source license used for software version control.
Explaining about why to use svn is not the point here. Let’s just leave it to wiki.
Suppose http://10.1.0.1/svn/Repo is the location of your repository. Instead of writing this whole url, I’ll write URL. A working copy will be a local copy of this repository at URL. Let’s call the path to the working copy as PWC
1. checkout / co
: Checkout a working copy from a repository.
svn checkout URL PWC
Now, you will have your own working copy of the repo. If path of working copy is not given then the base name of the repository will be created in present working dir. It basically creates a working copy for the user. It is one time thing.
: Commit an unversioned file or tree into the repository. The Repo/ need not exist before you import into it.
svn import URL
After importing data, note that the original tree is not under version control. To start working, you still need to svn checkout a fresh working copy of the tree.
3. commit / ci
: commit send changes from your working copy to the repository.
svn commit PWC svn commit -m "comment" PWC
If you are in the working copy, you can commit the present working directory like svn commit. The commit message is just optional.
4. update / up
: update brings changes from repository into working copy. If revision is not specified, it makes the working copy up to date.
To update whole working copy go there and type in
You can even update a specific file like
svn update [filepath from PWC]
Also you can update the particular file from your working copy to it’s any version like
svn update -r [filepath from PWC]
: add files and directories to the working copy. They will be uploaded and added to the repo when you commit the changes.
svn commit [file or dir path from PWC]
6. delete / del / remove / rm
: delete an item from working copy or the repository.
svn delete < file / dir path from PWC > / < file / dir path from URL >
svn commit [PWC]
: info displays information about a local or remote item. Go to the repository and type
8. list / ls
: list items of the repository.
svn list [URL]
: status recursively lists all the modified, deleted, added files. Go to the working copy and type in
: resolve the conflicts in a file
svn resolved [file path from PWC]
: relocate will let you relocate your repo to some other location
svn switch --relocate OLD_URL NEW_URL
: log will give you history of the revisions. It displays the user who has modified that version along with the message of revision. i.e. Message telling what the changes are done.
svn log [path of the file in your working copy]
To limit this log upto some number of entries then use it like
svn log -l <number of entries> <path of the file in your working copy>
: resolving tree conflicts can be a headache. Not anymore.
svn resolve --accept working -R
14. if it says “file is out of date” / “remains in tree-conflict”
svn update svn resolved <path of the directory in conflict> svn commit