Why use apache subversion command line tool
My memory is not too great, so I try to avoid using command line tools (it is quite annoying having to look up every other command in the help pages). But subversion is easy to use as it only has a couple commands. Here, I will describe the onces you will need most often (and maybe even the only once you will ever really need). The advantages of the command line are flexibility (you definitely can use all commands subversion offers, not all guis provide these), easy usage, and certainty that no extra bugs are added by a gui.Using apache subversion command line
svn help
svn help commandname
Download a complete new repository into subversion
Use this command if you want to use a repository that you have never used before:
svn checkout http://example.com/svnpath/repositoryname --username yourusername
Download changes in existing repository to local working copy
This will download all changes that others have committed to the remote repository to your local copy of it:
svn update
Add file to remote subversion repository
the first line adds the locally existing file filename under version control, the second line sends these changes to the remote subversion repository.
svn add filename
svn commit
svn commit
Add directories (recursive) to remote subversion repository
the first line adds all newly created files in the directory under version control, the second line sends these changes to the remote subversion repository.
svn add --depth=infinity *
svn commit
svn commit
Delete files or directories from remote subversion repository
the first line deletes the given file or directory (recursively) in local copy, the second one commits these changes to repository (meaning it will delete it on the server).
svn delete fileOrDirectoryName
svn commit
svn commit
Notes on committing
When doing a commit in svn, it is a good idea to add a message, so other people know what exactly you did.svn commit -m "added xyz and fixed abc"
General tips/ problem solving
- Login per command line not working: specify username with –username yourName
- if you are still having problems using your correct login credentials this command it might help to delete your keyring:
rm ~/.gnome2/keyrings/login.keyring
Tips on not breaking svn
- Do not move or change the .svn directories (well, except you really know what you are doing maybe, but then you would probably not be reading my text).
- Try changing the directory structure with svn build in commands (like delete or move) instead of doing it with a file manager
- Always do an update before making changes and a commit afterwards
- Do not use RapidSVN (more below)
- if you are working on a very large team or are not communicating with your few team members very well learn about and use the lock command to prevent files from being changed by multiple persons
Alternatives to subversion command line: SVN Guis
RapidSVN: Quite honestly, it sucks. It is at Version 0.12 and not being developed anymore (i think), so this really is no surprise. It broke more for me than it helped.Netbeans: works great (did not brake anything for me up to now); easy to use; color codes files right in IDE, which is quite useful. If you develop your project in Netbeans anyways, I suggest you use it.
That is already it so far for the tutorial about the svn command line tool. I think I covert all the basics (turns out it is less than I expected to write).