1

I would like to upload my web directory to google code for a project.

What is the terminal command that I would use to upload my directory to google code?

user229044
  • 232,980
  • 40
  • 330
  • 338
Erith
  • 69
  • 1
  • 8

1 Answers1

2

Simply add your ggogle code repo as a remote to your current local Git repo:

git remote add googlecode https://code.google.com/p/myprojectname 
git push googlecode master
git push googlecode --all 

If google code is your only upstream repo, you can name that remote origin instead of googlecode.

Make sure you local config (git config or in <your local repo>/.git/config) contains:

["origin"] 
fetch = +refs/heads/:refs/remotes/origin/ 
url = https://code.google.com/p/projectname/

(or ["googlecode"] if you choose that remote name)

Make sure you created the ~/.netrc (unix) or %HOME%/_netrc (windows, meaning you need to define HOME) file in your user home directory with following content:

machine code.google.com 
login <login> 
password <login>

And use the latest git version possible (like msysgit1.7.10 if you are on Windows)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @Erith what does `git remote -v` returns? – VonC May 08 '12 at 10:12
  • @Erith: answer edited with other recommendations. What version of Git are you using? Are you on Windows or Unix? What exact command are you typing when getting those error messages? Don't hesitate to edit your question to add those details rather than leaving a gazillon of comments ;) – VonC May 08 '12 at 10:42
  • @Erith: please let's on focus on the part where you " edit your question to add detail" rather than making those comments any longer ;) Try also a `git push googlecode googlecode:master` as in http://stackoverflow.com/a/620291/6309 – VonC May 08 '12 at 10:50
  • I followed VonC's recommendation to change my .netrc file and now i have an error so i changed that back to the original file ... then i followed his advice to add his lines and i got errors ... i will try your line and see i that works while i am in the directory that i need to upload from ... i imagine that would work ... – Erith May 08 '12 at 11:02
  • i just entered your code GIT PUSH GOOGLECODE GOOGLECODE:MASTER and i received the following ERROR src refspec googlecode does not match any ... does this have something to do with the config file from above? – Erith May 08 '12 at 11:06
  • @Erith Just to be sure, you did type that in lowercase, right? Also, editing your question with those commands and their output is useful. Finally, regarding your error message, check one of the answers at http://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git – VonC May 08 '12 at 11:12
  • dude ... i know newbs try the patience of masters like yourself ... but ... you focused more on my grammar than my question that you did not have an answer for all you did was direct me here or there ... if you do not have an answer that works for a newb ... dont post comments ... kapiche? – Erith May 08 '12 at 14:57