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

怎甘沉沦 提交于 2019-12-06 05:59:14

问题


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

回答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



回答2:


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!



来源:https://stackoverflow.com/questions/10202015/code-google-com-git-fatal-remote-error-repository-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!