Saturday, January 29, 2011

How to upload the code in code.google.com via svn ? «

How to upload the code in code.google.com via svn ? «

How to upload the code in code.google.com via svn ?

I was searching for a good tutorial to upload my code in code.google.com.

On the net i found many tutorials in Subversion. But i felt none helped me to upload my code in google hosting.

One day my friend Shrini sent me a link who always use to say to commit the code via svn.

Wah! that link was a nice one. Find it here http://techfandu.blogspot.com/2009/11/start-chat-to-google-code-hosting-for.html

It helped me to put my code in code.google.com.

After practising the information given in the link i decided to write a post on svn.

So that comes here.

SVN stands for Subversion. It is a free/open-source version control system initiated in 1999 by CollabNet Inc.

It is used to maintain current and historical versions of files such as source code web pages, and documentation.

To get introduction to Subversion & Version Control System read the wikipedia here

http://en.wikipedia.org/wiki/Subversion_%28software%29

http://en.wikipedia.org/wiki/Version_control_system

The following steps help to upload the code via svn or u can go through the link which i mentioned above

1. First of all, Subversion has to be installed

2. To install it, open a terminal and type the following command

sudo apt-get install subversion libapache2-svn

3. Click here http://code.google.com/hosting/createProject to go to google code create project page.

4. Search for project name which u decided by clicking the Search projects button on the top right corner.

If u find none, proceed with the create project form. Otherwise u have to choose another name.

5. Click the create project button and go to Source tab.

6. U can find two svn checkout commands. Use the project members svn checkout command.

7. Now open a terminal and create a directory to put ur code

For example,

mkdir MyCode
cd MyCode

8. Copy and paste ur svn checkout command in MyCode directory under the Source tab by removing the trunk from the command.

For example, svn checkout https://urprojectname.googlecode.com/svn/ urprojectname –username urusername

urprojectname – name of your project which u created

urusername – ur name used while creating ur project

9. This action will ask for password which u can find under the above command in Source tab by clicking googlecode.com password

10. It will result in the following output

A urprojectname/trunk
A urprojectname/branches
A urprojectname/tags
Checked out revision 1.

11. Now u can find the three directories under

MyCode/urprojectname/

12. Change to trunk directory cd trunk. Copy and paste the code file directly into trunk directory.

13. Type “svn status” command. It produces the following result.

? urcodefile

urcodefile – the files which u pasted in to the trunk directory

which means that it is a new file. u have to add this file to svn system

14. Now type “svn add urcodefile” which will result in the following output

A urcodefile

it means ur files are added into svn system.

15. Whatever done so for exists locally. Aim is to upload the code in code.google.com

16. To do this, type

“svn ci urcodefile”

17. This will open up a NANO Editor. Type some comments and Save it.

18. U can find the output as follows

Adding urcodefile
Transmitting file data .
Committed revision 2.

19. Thats all ur code is uploaded via svn. U can find the updates in http://code.google.com/p/urprojectname/updates/list

20. U can see ur files at http://code.google.com/p/urprojectname/source/browse/#svn/trunk

Also see this http://www.slideshare.net/kanchilug/sub-version-intro


Nice information about svn.

the following link have one pdf aboout subversion intro.

http://www.slideshare.net/kanchilug/sub-version-intro

its very easy to understandable one…

yeap !

4 comments: