Git push停止工作,并给出错误“找不到存储库"; git pull可以正常工作 [英] Git push stopped working, giving error "Repository not found"; git pull works ok
问题描述
git push
某个时候停止工作.
从命令行(和IDE)运行会出现以下错误:
Running from command line (and IDE) gives the following error:
F:\...>git push -v --set-upstream origin abc
Pushing to https://github.com/username/reponame
remote: Repository not found.
fatal: repository 'https://github.com/username/reponame/' not found
Github客户端能够推送分支,因此在github端没有权限.从命令行的Git拉动正常,所以它不是断键之类的东西.回购是私人的,我不会被允许执行拉取/提取.试图克隆到其他本地文件夹(git clone
也可以,顺便说一句),没有帮助.
Github client was able to push the branch, so it's not permissions on github side. Git pull from command line works ok, so it's not broken key or something. The repo is private, I wouldn't be let to perform pull/fetch. Tried to clone to other local folder (git clone
works ok too, btw), didn't help.
git version 2.14.3.windows.1
我能够在几个小时前进行推送,并且确定不会改变任何内容...
I was able to push few hours ago and pretty sure that didn't change anything...
>git remote -v
origin https://github.com/username/reponame (fetch)
origin https://github.com/username/reponame (push)
更新.尝试使用slon版本的url git@github.com:user/reponame.git
的ssh版本-推送正常!这基本上可以解决我的问题,但是我仍然想知道为什么它曾经像几个小时前一样工作,有时却停了下来.
Upd. Tried clonning ssh version of the url git@github.com:user/reponame.git
- and pushing works absolutely fine! This basically resolves my problem, but still I'm wondering why it used to work like few hours ago and at some moment just stopped.
推荐答案
对我有用的解决方案-切换到ssh url:在.git/config
The solution that worked for me - switching to ssh url: changing in .git/config
[remote "origin"]
url = https://github.com/username/reponame
到
[remote "origin"]
url = git@github.com:username/reponame
这篇关于Git push停止工作,并给出错误“找不到存储库"; git pull可以正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!