Git 推送停止工作,给出错误"Repository not found";git 拉取工作正常



git push停止工作。

从命令行(和IDE)运行以下错误:

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也可以正常运行,顺便说一句),没有帮助。

git version 2.14.3.windows.1

我能够在几个小时前推动,并且可以肯定不会改变任何东西...

>git remote -v
origin  https://github.com/username/reponame (fetch)
origin  https://github.com/username/reponame (push)

upd。尝试了url git@github.com:user/reponame.git的克隆ssh版本 - 推动绝对效果很好!这基本上是解决了我的问题,但我仍然想知道为什么它过去几个小时前就可以工作了,并且在某个时候就停止了。

对我有用的解决方案 - 切换到SSH URL:.git/config

更改
[remote "origin"]
    url = https://github.com/username/reponame

to

[remote "origin"]
    url = git@github.com:username/reponame

您还需要指定用户名 密码。通常,凭证管理器存储这些信息,但在某些情况下这些信息丢失了。

只使用以下语法:

git push -v --set-upstream origin abc https://username:passwd@github.com/username/reponame

最新更新