4

I have created a new repository in code.google.com, generated the code.google.com password and updated my ~/.netrc with

machine code.google.com login <email-id> password <password>

As per the instruction in the code.google.com, I was able to clone the repository using the following command:

git clone https://code.google.com/p/<repository-name>/

and after that I added some files to the repository and executed, git add, followed by git commit. But when I executed git push origin master it gave the following error

fatal: remote error: Repository not found

When google'ed for this issue, I found couple of links but the work-around that was mentioned in that didn't seem to work. Any suggestion would be highly appreciated!

UPDATE: I have tried the following work-arounds but unsuccessful:

  1. Update the url in the .git/config to take username and password
  2. Give the username and password in the url in the git clone command
  3. Update username and password with global git config command
Charles
  • 50,943
  • 13
  • 104
  • 142
Sangeeth Saravanaraj
  • 16,027
  • 21
  • 69
  • 98
  • Just to be sure, your `.netrc` has three lines in it, right? (as in http://stackoverflow.com/questions/6031214/git-how-to-use-netrc-file-on-windows-to-save-user-and-password/6031266#6031266) Not one line like shown ni your question? – VonC Apr 18 '12 at 06:04

2 Answers2

1

Try 'git remote show origin' to confirm the remote communication.

Is the 'security' button checked at Google Project Hosting. If so, maybe you are using the wrong password (Google Code password versus Google Account password).

[edit]

When you clone a Google project, you get a custom repository name. For example, I cloned the 'playn' project and was given a project name of 'gozoner-playn-too' (based on the info that I provided). When you make your local clone it needs to be of this repository. In my case:

git clone https://code.google.com/p/gozoner-playn-too

And the push then works:

$ git push origin
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 256 bytes, done.
...

Note, if you've already checked out the wrong clone (like I suspect) you can change the url to the correct one with:

git remote set-url origin https://code.google.com/p/gozoner-playn-too

After this the .git/config file has this:

[remote "origin"]
  fetch = +refs/heads/*:refs/remotes/origin/*
  url = https://code.google.com/p/gozoner-playn-too
GoZoner
  • 67,920
  • 20
  • 95
  • 145
  • `* remote origin Fetch URL: https://code.google.com/p/ Push URL: https://code.google.com/p/ HEAD branch: master Remote branch: master tracked Local branch configured for 'git pull': master merges with remote master Local ref configured for 'git push': master pushes to master (fast-forwardable)` – Sangeeth Saravanaraj Apr 18 '12 at 03:46
  • The security button is not checked.. And I use exactly (copy-paste) the same credentials that is shown in hosting project page in my ~/.netrc file. I have all the admin authority. I see all the permission buttons checked. – Sangeeth Saravanaraj Apr 18 '12 at 03:48
  • Yes. I am able to recreate your exact problem with my Google Code account. The 'git remote show' looks perfect; 'git fetch' seems to work; 'git push' fails. – GoZoner Apr 18 '12 at 03:53
  • Ack. A quick google search tells that there are many users who face this problem. I'll keep searching for a solution. Will let you know if I come across one! – Sangeeth Saravanaraj Apr 18 '12 at 04:02
  • The permission on your ~/.netrc is 600? The 'machine' line in that file ends with a newline? – GoZoner Apr 18 '12 at 05:55
  • Yes and yes. They seem to be fine. – Sangeeth Saravanaraj Apr 18 '12 at 12:10
  • Perhaps it is the trailing slash ('/') in your git clone command. Is that slash shown in the URL when you do 'git remote show origin'? If so, the code.google.com web server might not be seeing a valid https URL. – GoZoner Apr 18 '12 at 15:45
1

You did everything as the code.google.com says.But you also need to add the remote origin to git.It is like...

git remote add origin https://code.google.com/p/your-project-name

then push the added code like...

git push orgin --all

For start-up to code.google.com git use see the complete instruction here http://matrixsust.blogspot.com/2012/06/1.html

Hope it helps!

Robel Sharma
  • 964
  • 1
  • 11
  • 26