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

(编辑:jimmy 日期: 2024/9/21 浏览:2)

解决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的相应帮助

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

一句话新闻

微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。