Search code examples
gitgoogle-code

code.google.com: git: fatal: remote error: Repository not found


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

Solution

  • 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