git 远程:未找到存储库致命:未找到
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25337199/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
remote: repository not found fatal: not found
提问by Peter Arevalo
Why won't my git push? I created the repository and I keep getting this message:
为什么我的 git 不推送?我创建了存储库,并且不断收到此消息:
C:\Users\petey_000\rails_projects\first_app>git push -u github master
Username for 'https://github.com': ***@gmail.com
Password for 'https://***@[email protected]':
remote: Repository not found.
fatal: repository 'https://github.com/pete/first_app.git/' not found
回答by VonC
Your username shouldn't be an email address, but your GitHub user account: pete
.
And your password should be your GitHub account password.
您的用户名不应是电子邮件地址,而是您的 GitHub 用户帐户:pete
.
您的密码应该是您的 GitHub 帐户密码。
You actually can set your username directly in the remote url, in order for Git to request only your password:
您实际上可以直接在远程 url 中设置您的用户名,以便 Git 仅请求您的密码:
cd C:\Users\petey_000\rails_projects\first_app
git remote set-url origin https://[email protected]/pete/first_app
And you need to create the fist_app
repo on GitHub first: make sure to create it completelyempty, or, if you create it with an initial commit (including a README.md
, a license file and a .gitignore
file), then do a git pull first, before making your git push
.
并且您需要fist_app
首先在 GitHub 上创建repo:确保将其创建为完全空的,或者,如果您使用初始提交创建它(包括一个README.md
、一个许可证文件和一个.gitignore
文件),然后在创建之前先执行 git pull你的git push
。
回答by Gaurav
If this problem comes on a Windows machine, do the following.
如果此问题出现在 Windows 计算机上,请执行以下操作。
- Go to Credential Manager
- Go to Windows Credentials
- Delete the entries under Generic Credentials
- Try connecting again. This time, it should prompt you for the correct username and password.
- 转到凭据管理器
- 转到 Windows 凭据
- 删除通用凭据下的条目
- 再次尝试连接。这一次,它应该提示您输入正确的用户名和密码。
回答by sethvargo
Three things:
三件事:
- Your GitHub username is not an email address. It should be a username (like "sethvargo")
You have a trailing slash on your repo name:
$ git remote rm origin $ git remote add origin https://github.com/pete/first_app.git
You need to create the
first_app
repo. I looked at "pete" on GitHub, and I do not see the repository. You must first create the remote repository before you may push.
- 您的 GitHub 用户名不是电子邮件地址。它应该是一个用户名(如“sethvargo”)
您的回购名称上有一个斜杠:
$ git remote rm origin $ git remote add origin https://github.com/pete/first_app.git
您需要创建
first_app
回购。我在 GitHub 上查看了“pete”,但没有看到存储库。您必须先创建远程存储库,然后才能推送。
回答by bharat udasi
I have solved the same issue by giving the read permision from github account.
我通过从 github 帐户提供读取权限解决了同样的问题。
- Go to github account go the user write permission.
- When we clone the code we need read permission.
- When we need to push the code we use write permission so you need to give write permission.
- 转到 github 帐户转到用户写入权限。
- 当我们克隆代码时,我们需要读取权限。
- 当我们需要推送代码时,我们使用写权限,因此您需要授予写权限。
回答by Billal Begueradj
I faced exactly the same error message. When I run ls -a
, I found out that .git was missing (surely I deleted it by inadvertence in previous days). As what I have locally is the same as on the Github repository, I simply removed my local "folder" and cloned the remote one again. After that, everything worked fine for me:
我遇到了完全相同的错误消息。当我运行时ls -a
,我发现 .git 丢失了(当然我前几天无意中删除了它)。由于我在本地拥有的与 Github 存储库中的相同,因此我只是删除了本地“文件夹”并再次克隆了远程文件夹。在那之后,一切对我来说都很好:
rm -rf my_project
git clone https://github.com/begueradj/my_project.git
回答by Avinash Thombre
Make sure your git username and password is correct. In my case, it gave error when the username and password(especially the GIT TOKEN) was not correct.
确保您的 git 用户名和密码正确。就我而言,当用户名和密码(尤其是GIT TOKEN)不正确时,它会出错。
回答by Taslim Oseni
This answer is a bit late but I hope it helps someone out there all the same.
这个答案有点晚了,但我希望它对那里的人有所帮助。
In my case, it was because the repository had been moved. I recloned the project and everything became alright afterwards. A better alternative would have been to re-initialize git.
就我而言,这是因为存储库已被移动。我重新克隆了这个项目,之后一切都好了。更好的选择是重新初始化 git。
I hope this helps.. Merry coding!
我希望这会有所帮助.. 编码快乐!
回答by Nigrimmist
Also, be sure, that two-factor authenticationis off, otherwise use personal access tokens
另外,请确保两因素身份验证已关闭,否则请使用个人访问令牌
Details here : Can I use GitHub's 2-Factor Authentication with TortoiseGit?
此处的详细信息:我可以将 GitHub 的 2-Factor Authentication 与 TortoiseGit 一起使用吗?