Tuesday, 9 November 2010

svn command in unix - basic steps

I have replaced the old subversion client with unix command "svn" few days ago. Here comes some basic steps to use it:

(Note that you have to go to the directory of the file where you want to manage svn)

svn checkout svn_web_direction local_directory
It download the content of the subversion server to your local directory. Normally it requires the user name and the password.

Add file/directory
svn add directory
svn add file
add a directory or a file to the svn server. Note that for now the directory or file has just added locally. If you want to it appears on the server, you have to commit.

svn commit -m "Message"
Used to commit (update) all the changes made locally to the server. You can add a message about the modifications that you have done. Here is very important that svn will only commit the directory which is below to the actual directory. All the changes in the above directory won't be committed!

svn update
Get the last version of the server. Don't worry about your modifications, it will be keep in your computer. The svn will merge the last version with the version which is in your computer. Sometimes conflicts could appears. You can see how to solve them here.

svn status
Check the status of local changes. All the modifications in the subdirectories should be appears here. The modifications will be classified into different types. You will notice them from the first character. Here are some examples:
  • A: Added
  • C: Conflicted
  • D: Deleted
  • M: Modified
  • R: Replaced

No comments:

Post a Comment