Tuesday, 5 June 2007

Using google's free SVN repository with Eclipse

Ok - here are some very quick notes on getting a google svn hosting account set up with eclipse; as google is offering us all such an amazing resource, I have a feeling I'll be doing this again some time whilst working on other projects...

If you already have a gmail account, make sure you're logged in (that way, your repository and your account will be linked).

Start here:
http://code.google.com/hosting/
Go to the 'Create a new Project' link and create your project...

Install eclipse if you haven't already (current recent version is 3.5):
http://www.eclipse.org/downloads/

Now you need to install the subclipse plugin from within eclipse..
Here are some step-by-step instructions:
http://subclipse.tigris.org/install.html

Once that's done you should be able to open your repository as a new project within eclipse.

Within the package explorer (the panel on the left if you're in the java developer perspective), right click to get the context menu and go to 'New' and 'Other...'

expand the SVN folder and select 'Checkout Projects from SVN' and select Next

Select the Create a new repository location and select Next

The URL will be:

https://[YOUR_PROJECT_NAME].googlecode.com/svn

If you don't use https:// you'll check out the repository as read only

Select (highlight) the folder to check out as an eclipse project (e.g. trunk) and select Next.

Select the check out as a project configured using the New Project Wizard and select 'Finish'

For this exercise, I'm checking mine out as a java project, so I'm selecting Java Project and Next on the wizard box.

Give the Project a name (e.g. myProject), select Finish and OK

Let it check out your project...

You should see something like myProject [trunk] in the package explorer.
You can now right click on the folder and go to New > Folder and create a new folder

When you're ready, right click on the folder you've created, go to the Team context menu and select 'Add to Version Control'; you'll probably need to do this for any new files you subsequently add...

From then, commit will add new changes and update will refresh a stale repository.

One other note: to check out the project, I used my gmail username. The svn password isn't the same as your gmail password though.

I found the password for the code repository (when logged in) here - so hopefully this will help:

http://code.google.com/hosting/settings

NB: I've seen situations where subclipse (or subversion) would keep asking for a password; I managed to stop it from doing this by going into the Eclipse > Window > Preferences, expanding the Team folder, selecting SVN and ensuring that the SVN interface was selection was set to SVNKit (Pure Java).

27 comments:

Dimitri said...

Nice tutorial. Was very usefull.

chintanonline said...

Nice tutorial, but I have a question regarding the license. If I dont want other people to see my code except those whom I give permission, which license shall I select while creating a project? Can you guide me through it?

Ward said...

Thanks for the quick tutorial, it helped me out to get an environment up and running in a matter of minutes.

Pensador said...

Thanks much for the tutorial. I have the same question as chintanonline: is there a way to make my code only viewable by team members?

lechumur said...

Thanks for the tutorial! It helped to resolve my issues :)

Alex Bleasdale said...

Hi chintanonline and Pensador - I'm sorry; not sure whether you can restrict access to those repositories. Is there an option when you set them up in the first place?

rudisoft said...

I usually don't comment on blogs, but this time I had to! Thank you very much for this tutorial, it was very usefull. Very apreciated!

Pauli said...

Thank you! This was very useful for me!

Eli said...

It worked great!
Thank you.

Alex M said...

Great work - thanks

Mattijs said...

Thanks for the tutorial. It might be an idea to put a little * next to "If you don't use https:// you'll check out the repository as read only", then put another * below with the "One other note: ".

It took me a detour via google to get back to this article and find the extra note..

Cheers,

bob said...

Dude, you are great

PS: the only blog i have posted in

Alex Bleasdale said...

Thanks for all the comments - glad this post has been useful!

@Mattjs - thanks for the advice, based on your comments, I've hopefully drawn a bit more attention to the https issue :)

Ashneel said...

Thanks a lot, was a great help

Sri said...

Solid!!! Just the quick start I was looking for...if only google gave you higher page rank, I wouldn't have wasted 2 hours searching elsewhere. THANKS!!

P.S.First time I've ever commented on a blog

Caoimghgin said...

There is a missing step in this otherwise informative post. See http://blog.punchbarrel.com/tag/svn/ to install third party SVN connectors so you can upload and download projects into google.

Mamta said...

Thank you so much for the blog. It helped a great deal! :) and i checked out my first proj today

Mohan said...

Thanks a lot it helped me a lot.

Um guineense por aĆ­ said...

Thanks a lot

pingunaut said...

Thank you! Saved me hours of searching ;)

digi said...

nice one,
i got the password reset link very useful :)

Mike Harris said...

http://code.google.com/p/support/wiki/Permissions

Mike Harris said...

Projects is strictly Open Source and administrators cannot restrict read access to source code.

http://code.google.com/p/support/wiki/Permissions

Aqeel Aslam said...

Just to tell you that your post is still helping people like me out there. Excellent post.

Thank you very much ...

Just think it would've been even more better if you could add screenshots of different steps.

Thanks a LOT.

Ashok said...

Thanks nice tutorial, really helpful.

mian muzammiol rahman said...

On this webpage, we have listed the most reliable website hosting providers in the UK, who, in our 10 years of experience, have proved to be offering top quality
Top 10 UK Website Hosting

born2win said...

Wonderfull. i had setup my svn with google code. but the sad news is google code will not allow the service from jan 14 2014

http://google-opensource.blogspot.ca/2013/05/a-change-to-google-code-download-service.html