在某个时刻,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
- 并推动工作绝对正常!这基本上解决了我的问题,但我仍然想知道为什么它曾经像几个小时前一样工作,并在某个时刻刚刚停止。
对我有用的解决方案 - 切换到ssh url:在.git/config
中更改
[remote "origin"]
url = https://github.com/username/reponame
至
[remote "origin"]
url = [email protected]:username/reponame
您还需要指定用户名+密码。通常,凭证管理器存储这些信息,但在某些情况下,这些信息会丢失。
只需使用以下语法:
git push -v --set-upstream origin abc https://username:[email protected]/username/reponame