在使用git push命令将改动的文件提交到远程仓库时,git bash提示错误:
fatal: remote error: You can’t push to git://github.com/user/repo.git Use https://github.com/user/repo.git,
下面是出现这一错误的原因分析:
1.首先我从远程仓库clone到本地时使用的命令是:git clone git://github.com/user/repo.git
;
2.提交改动时报错:fatal: remote error: You can’t push to git://github.com/user/repo.git Use https://github.com/user/repo.git
。
之所以出现这样的情况原因是:
像 git clone git://github.com/user/repo.git
这样的url请求是只读的,像git@github.com:user/repo.git
以及 HTTPS URL比如: https://github.com/user/repo.git
才是可写的,具体描述见官网:https://help.github.com/articles/pushing-to-a-remote/#what-can-i-push-to;
所以解决办法如下:
git remote rm origin
git remote add origin git@github.com:user/repo.git
git push origin master
最新评论
怎么获取下载密码不对啊?
你给钱了吗在这叫
夸克和百度给了你钱吧?这么多不限速的网盘不用,限速限的一坨屎一样的网盘拼命推荐
博主能不能回复一下具体什么时候更新新版,我怕到时候强制更新就用不了