fatal:remote error:You can't push to 解决fatal:remote error:You can't push to git://github.

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

fatal:remote error:You can't push to 解决fatal:remote error:You can't push to git://github.

流沙的刺客   2021-03-22 我要评论
想了解解决fatal:remote error:You can't push to git://github.com/username/*.git问题的办法的相关内容吗,流沙的刺客在本文为您仔细讲解fatal:remote error:You can't push to 的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:fatal:remote,error,fatal:remote,error:You,can''t,push,to,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 git@github.com:username/*.git

看来我是没有权限push啊。

解决方法:

git remote rm origin
git remote add origin git@github.com:username/resname.git

接下来就可以push了。 

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

要用ssh协议才能push所以clone用git@github.com:username/userrepository.git

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

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

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们