You are on page 1of 6

How to set up git with google code

zhiyiw@cs.uoregon.edu The overview of 2 version control system: A. Centralized version control: SVN,CVS,Perforce

All the files are in the center hub, its dangerous and if something wrong happen to the server, its hard to rollback.

B.Decentralized/Distributed version control:Git, Mercurial. Bazaar

So you have more reliable data backup in all the participants workstation. Plus have a repository on your own computer can provide you offline code rollback.

1. Create Google account: https://accounts.google.com/NewAccount if you have your google account working, skip this step. 2. Create a new project in Google code: http://code.google.com/hosting/ click create new project

Then fill the information as you like, there are some restriction with the project name, make sure it follow the name orders. Remember to choose Git as your version control system. Project name cis415-project Project summary Assignments for cis 415 Description anything you like
Version control system Git Source code license GNU GPL v3 Project label(s) Academic, assignment

3. Project setup: https://code.google.com/hosting/settings Copy and keep track of your googlecode password which generated automatically. Check the Security under User Preferences

4. Project management: Back to your project page: https://code.google.com/p/you-project-name *Remember to change the you-project-name to your project name

Select "Source-Checkout" Option 1: Copy the phragraph: git clone https://your-gmail-name@code.google.com/p/cis415-project/ and checkout the code in your directory Option 2: Create a .netrc file under your /Home directory and paste this to your .netrc: machine code.google.com login your-gmail-name@gmail.com password your-passwordfrom-google *The your-password-from-google from Step 3 Option is good for bypass the password input part every time you use the git clone. Back to your working directory, use this code to check out your ceode: git clone https://code.google.com/p/you-project-name *Remember to change the you-project-name to your project name When you finish your project, change to the project directory, and use this command to push it to google server: git push orgin --all

5. Push your exist project file to git: Change to your project directory, init git and push the code. git init git add . Dont forget the . git commit -a -m "Initial Branch" Then add the project to google code:

git remote add origin https://code.google.com/p/you-project-name *Remember to change the you-project-name to your project name Finally, Push the code to google code: git push orgin --all

Other helpful reference: http://gitref.org/ http://git-scm.com/documentation

You might also like