My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
BasicSubversionUsage  

Featured, DeveloperDoc
Updated Jun 19, 2007 by thelinuxmaniac

Basic SVN usage

1. For the first you need to create a local copy of the source tree in your computer. This is termed as "checkout".

[root@tlm ~]# svn checkout https://machapuchhre.googlecode.com/svn/trunk/machapuchhre --username YOUR_USER_NAME --password YOUR_PASSWORD

You need to "checkout" only for the first time. After executing the above command, you will have the local source tree. You can perform modifications,addition,deletion of files as you wish.

2. To add files/directories to svn:

[root@tlm ~]# svn add DESIRED_FILE.EXT
[root@tlm ~]# svn add DESIRED_DIRECTORY

[root@tlm ~]# svn del DESIRED_FILE.EXT
[root@tlm ~]# svn del DESIRED_DIRECTORY

You can view the status of your local source tree using

[root@tlm ~]# svn status

3. After making all the desired changes , if you wish to write your changes to SVN source tree, you will "commit" your files to remote SVN tree.

[root@tlm ~]# svn commit --message "THE _DESCRIPTIVE_ LOG MESSAGE YOU WANT TO SET FOR THIS COMMIT" --username YOUR_USER_NAME --password YOUR_PASSWORD

4. To update you local source with the remote SVN tree (ie: to bring you local tree in sync with remote tree)

[root@tlm ~]# svn update --username YOUR_USER_NAME --password YOUR_PASSWORD

5. To see who has commited changes in the repository

[root@tlm ~]# svn log

6. Resolving Conflicts: When you do an update or commit

[root@tlm ~]# svn update
C  foo.c
Updated to revision 31.
[root@tlm ~]# ls
foo.c
foo.c.mine
foo.c.r30
foo.c.r31

this means that a conflict has occured in the file "foo.c". In other words, you have made modifications to "foo.c" in the same area that other developer has also made.

  • foo.c.mine - contains the copy of "foo.c" with the changes you have made
  • foo.c.r30(1) - contains the copy of "foo.c" with the changes others have made
Call or email the other developer and resolve the conflicting code by making changes to foo.c . Now issue the command:

[root@tlm ~]# svn resolved
[root@tlm ~]# svn commit

TO GET YOUR PASSWORD FOR SVN goto "http://code.google.com/hosting/settings" after loggin into googlecode with your gmail account

Powered by Google Project Hosting