git github不能推到原点 [英] git github cannot push to origin

查看:245
本文介绍了git github不能推到原点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能错过了一些东西,但是我确定我已经检查了所有东西,
我分叉了一个回购库并将其克隆在我的系统上,
在提交$后做了一些更改
b $ b是 git push origin master



它表示

 致命:远程错误:
您无法推送到git://github.com/my_username/my_repo.git
使用git@github.com :my_username / my_repo.git

我错过了什么吗?
然后我尝试了

git remote add origin https://github.com/my_username/my_repo.git



返回



致命:远程原点已存在。



我不明白为什么会发生这种情况,请帮助解决方案

b $ b

  git://github.com/my_username/my_repo.git 

git://只给出只读访问权限,就像在边上提到的一样。






<$>

p $ p> git@github.com:my_username / my_repo.git

提供网站中提及的读写访问权限。这里描述>



尽管 https://github.com/my_username/my_repo.git 也读过并写入访问权限,但它在您的情况下不起作用,因为您尝试使用相同的名称创建新的远程,而不是重置它。所提到的正确语法是:
$ b $ g $ git remote set-url origin git@github.com:my_username / my_repo.git





  git remote set-url原始地址https:/ /github.com/my_username/my_repo.git 

也可以使用。


I may be missing something, but I'm sure that I've checked everything, I forked a repo and cloned it on my system, made some changes after commiting did git push origin master

it says

fatal: remote error: 
  You can't push to git://github.com/my_username/my_repo.git
  Use git@github.com:my_username/my_repo.git

Am I missing something? then I tried git remote add origin https://github.com/my_username/my_repo.git

it returned

fatal: remote origin already exists.

I dont understand why this is hapenning, pls help

解决方案

The url with

git://github.com/my_username/my_repo.git

git:// Only gives read only access as mentioned in the side too..

Whereas,

git@github.com:my_username/my_repo.git

gives read and write access as mentioned in site

Though, https://github.com/my_username/my_repo.git also has read and write access but it was not working in your case because you trying to create a new remote with the same name instead of resetting it. The correct syntax as mentioned was

git remote set-url origin git@github.com:my_username/my_repo.git

And

git remote set-url origin https://github.com/my_username/my_repo.git

would also work.

这篇关于git github不能推到原点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆