解决fatal:remote error:You can't push to git:github.comusername*.git问题的办法

解决fatal:remote error:You can't push to git:github.comusername*.git问题的办法,第1张

解决fatal:remote error:You can't push to git://github.com/username/*.git问题的办法

解决fatal:remote error:You can't push to git://github.com/username/*.git问题的办法

今天Git push的时候

fatal:remote error:
You can't push to git://github.com/username/*.git
Use [email protected]:username/*.git

看来我是没有权限push啊。

解决方法:

git remote rm origin
git remote add origin [email protected]:username/resname.git

接下来就可以push了。 

这个问题一般是clone的时候选择的协议导致的。如果是用的git://github.com/userna/userrepository.git。只有读的权限,不能写入。导致不能push。

要用ssh协议才能push所以clone用[email protected]:username/userrepository.git

用ssh还必须要创建一个SSH Key。并把公钥填写到用户在GitHub的信息里。具体看GitHub的相应帮助

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/902222.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-15
下一篇 2022-05-15

发表评论

登录后才能评论

评论列表(0条)

保存