git github无法推动原点

pah*_*nin 10 git push github

我可能会遗漏一些东西,但我确信我已经检查了所有内容,我将一个仓库分叉并将其克隆到我的系统上,在提交后做了一些更改 git push origin master

它说

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
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?然后我试了 git remote add origin https://github.com/my_username/my_repo.git

它回来了

致命的:远程起源已经存在.

我不明白为什么这是hapenning,请帮忙

vin*_*hew 21

网址用

git://github.com/my_username/my_repo.git
Run Code Online (Sandbox Code Playgroud)

git://只提供侧面提到的只读访问权限..

在此输入图像描述

然而,

git@github.com:my_username/my_repo.git
Run Code Online (Sandbox Code Playgroud)

提供站点中提到的读写访问权限

在此输入图像描述

虽然,https://github.com/my_username/my_repo.git也具有读写访问权限,但它在您的情况下不起作用,因为您尝试创建具有相同名称的新远程而不是重置它.提到的正确语法是

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

和

git remote set-url origin https://github.com/my_username/my_repo.git
Run Code Online (Sandbox Code Playgroud)

也会有用.


Yuv*_*dam 5

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