Git Push错误:未找到存储库

本文翻译自:Git Push ERROR: Repository not found

I am having a very strange problem with git and github . 我在gitgithub遇到一个非常奇怪的问题。 When I try and push, I am getting: 当我尝试推动时,我得到:

git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

I added the remote: 我添加了遥控器:

git remote add origin git@github.com:account-name/repo-name.git

Any ideas? 有任何想法吗?


#1楼

参考:https://stackoom.com/question/gRjJ/Git-Push错误-未找到存储库


#2楼

If you include your username and the repo name we can reasonably help you, at the moment we have no reason to think the repo does actually exist. 如果您包括您的用户名和回购名称,我们可以为您提供合理的帮助,目前我们没有理由认为该回购确实存在。

Additionally, if the repo is private and you don't have access to it, github returns "Does not exist" to avoid disclosing the existance of private repos. 另外,如果存储库是私有的,并且您无权访问它,则github返回“不存在”,以避免公开私有存储库的存在。

EDIT: If you're not able to clone it because it's saying it doesn't exist and it's private, it's because you're not sending authentication. 编辑:如果您不能克隆它是因为它不存在并且是私有的,那是因为您没有发送认证。 Ensure that your public key is added to your keyring, or use HTTP basic auth for the time being. 确保将公共密钥添加到密钥环,或者暂时使用HTTP基本身份验证。


#3楼

Check to see if you have read-write access. 检查您是否具有读写访问权限。

The Git error message is misleading. Git错误消息具有误导性。 I had a similar issue. 我有一个类似的问题。 I had been added to an existing project. 我被添加到现有项目中。 I cloned it and committed a local change. 我克隆了它,并进行了本地更改。 I went to push and got the ERROR: Repository not found. 我去推送并得到了ERROR: Repository not found. error message. 错误信息。

The person who added me to the project gave me read-only access to the repository. 将我添加到项目中的人向我授予了对存储库的只读访问权限。 A change by them and I was able to push. 他们的改变使我得以推动。


#4楼

I was getting the same error 我遇到了同样的错误

ERROR: Repository not found.   
fatal: The remote end hung up unexpectedly

and I had created the repository on Github and cloned it locally. 我在Github上创建了存储库,并在本地克隆了它。

I was able to solve by opening .git/config and removing the [remote "origin"] section. 我可以通过打开.git / config并删除[remote "origin"]部分来解决。

[remote "origin"]   
   url = git@github.com:alexagui/my_project.git  
   fetch = +refs/heads/*:refs/remotes/origin/*

then I ran the following (again) 然后我再次运行以下内容

git remote add origin git@github.com:alexagui/my_project.git  
git push -u origin master

and this time I was able to push to the repository. 这次我能够推送到存储库。


#5楼

Changing the content of the .git/config file helps as Alex said above. 正如上面所说的,更改.git / config文件的内容会有所帮助。 I experienced the same problem and I think it was because I changed my Github username. 我遇到了同样的问题,我认为这是因为我更改了Github用户名。 The local files could not be updated with the changes. 本地文件无法使用更改进行更新。 So perhaps anytime you change your username you might consider running 因此,也许每当您更改用户名时,您都可以考虑运行

git remote add origin your_ssh_link_from_github

I hope this helps ;) 我希望这有帮助 ;)


#6楼

I had the same problem. 我有同样的问题。 My issue was misunderstanding that I had to first create the empty repo on github before pushing to it. 我的问题是误解,我必须先在github上创建空仓库,然后再推送到仓库。 Doh! h! Including this here for anyone else who doesn't realize. 在这里把它包括给其他没有意识到的人。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值