Wednesday 13 February 2013

How To Host Files Using Googlecode And Subversion?

Googlecode is a free platform to host your Open Source Projects and Files.There are many websites in the world of internet which allows you to host your HTML files or pages for free,but you must choose googlecode subversion over them because googlecode provides you unlimited storage(4069 MB,it is too large for your HTML,CSS,JS and other files) and unlimited bandwidth,it is the biggest problem of other sites,when you exceeds their bandwidth,you will get their message in place of your file or page,it is so irritating and annoying thing for our readers.If you want to know more about Google Code then read this page.Now without waiting  anymore let's go to the tutorial.


How To Host Files Using GC. And Subversion?

For easy understandings I am dividing this tutorial in three parts and they are as below,


  1. Creating a new project at googlecode
  2. Downloading and Configuring the SVN client
  3. Uploading files using your SVN client.


Part 1 : Creating A New Project At Googlecode

Before starting you must login to your googlecode account,if you have not created till then go to code.google.com and register/login with your google account.After login follow below steps to create a new project.

Go to Googlecode Project Hosting and click on Create a new project,Now you will redirect to the create new project page.
Fill the below fields like I have filled un below image and make sure that you have selected "Subversion" as Version Control system.



  • Once you click on Create Project button you will redirect to the another page.Now click on Source tab.
               
On this page you will find a URL like below,copy that URL and paste it into your notepad.

https://mjmirza.googlecode.com/svn/trunk/mjmirza

                        

Now click on googlecode.com password link,copy your password and paste it into notepad.

                                 

Now you have done all the steps which are necessary to upload files to googlecode.Now lets see how to upload files to googlecode using subversion

Part 2 : Downloading And Configuring SVN Client

We will upload files using Subversion client.We will use TortoiseSVN as our subversion client.Folloe below simple steps to upload files using subversion client.

  • Go to TortoiseSVN
  • Download by selecting your system type (32bit or 64bit)
  • Install it
  • Now open your main screen (desktop) 
  • Right Click and navigate to Tortoise SVN > Settings
              

Go to setting and then click on Edith button



Now a text document file will open which holds all the records for the mime-type of the files to be uploaded.At the end of the text document hit enter,copy and paste the below code and save it.




[miscellany]
### Set global-ignores to a set of whitespace-delimited globs
### which Subversion will ignore in its 'status' output, and
### while importing or adding files and directories.
### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
# global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
#   *.rej *~ #*# .#* .*.swp .DS_Store
### Set log-encoding to the default encoding for log messages
# log-encoding = latin1
### Set use-commit-times to make checkout/update/switch/revert
### put last-committed timestamps on every file touched.
# use-commit-times = yes
### Set no-unlock to prevent 'svn commit' from automatically
### releasing locks on files.
# no-unlock = yes
### Set mime-types-file to a MIME type registry file, used to
### provide hints to Subversion's MIME type auto-detection
### algorithm.
# mime-types-file = /path/to/mime.types
### Set preserved-conflict-file-exts to a whitespace-delimited
### list of patterns matching file extensions which should be
### preserved in generated conflict file names.  By default,
### conflict files use custom extensions.
# preserved-conflict-file-exts = doc ppt xls od?
### Set enable-auto-props to 'yes' to enable automatic properties
### for 'svn add' and 'svn import', it defaults to 'no'.
### Automatic properties are defined in the section 'auto-props'.
# enable-auto-props = yes
### Set interactive-conflicts to 'no' to disable interactive
### conflict resolution prompting.  It defaults to 'yes'.
# interactive-conflicts = no
### Set memory-cache-size to define the size of the memory cache
### used by the client when accessing a FSFS repository via
### ra_local (the file:// scheme). The value represents the number
### of MB used by the cache.
# memory-cache-size = 16
### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match (case-insensitively) will be
### applied to the file.  Note that auto-props functionality
### must be enabled, which is typically done by setting the
### 'enable-auto-props' option.
# *.c = svn:eol-style=native
# *.cpp = svn:eol-style=native
# *.h = svn:keywords=Author Date Id Rev URL;svn:eol-style=native
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
# *.sh = svn:eol-style=native;svn:executable
# *.txt = svn:eol-style=native;svn:keywords=Author Date Id Rev URL;
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
# Makefile = svn:eol-style=native

Now we have successfully configured TortoiseSVN,now lets see hoe to upload the files using this client.

Part 3 :Uploading The Files Using SVN Client

Open the folder containing your files.Right click anywhere in folder and navigate to TortoiseSVN > Repo-browser.
                 

A small window will open.Here you have to put the URL which we have noted down in first part,Enter the URL and hit Ok button.


  • Now it will ask you to enter username and password.Enter your google email as your username and enter the password which we have noted down in first part.Finally click Ok button.
  • Now a window will open.Just drag the files into that window and wait until the file names includes in that window.
  • When your file uploaded click on the file name and note down the the URL of your file.







In file URL just remove s from https:// and make it http://
Open the link using Browser.
All Done ! That is all about hosting files to Googlecode using Subversion,I hope this tutorial helped you.By using this method you can host your css,js,html and other files for your blogger blog.Also if you are facing any little problem then feel free to share it with me :)

No comments:

Post a Comment