Git push停止工作,给出错误“未找到存储库”; git pull工作正常

问题描述 投票:1回答:2

在某个时刻,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 pull工作正常,所以它不是破坏键或什么的。回购是私有的,我不会被允许执行拉/取。试图克隆到其他本地文件夹(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。尝试克隆ssh版本的网址[email protected]:user/reponame.git - 并推动工作绝对正常!这基本上解决了我的问题,但我仍然想知道为什么它曾经像几个小时前一样工作,并在某个时刻刚刚停止。

git github
2个回答
1
投票

对我有用的解决方案 - 切换到ssh url:在.git/config中更改

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

[remote "origin"]
    url = [email protected]:username/reponame

0
投票

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

只需使用以下语法:

git push -v --set-upstream origin abc https://username:[email protected]/username/reponame
© www.soinside.com 2019 - 2024. All rights reserved.