且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用一个遥控器推送到另一个URL并从另一个URL进行拖动?

更新时间:2022-04-18 22:09:02

您正在寻找的命令是:

The command you are looking for is:

git remote set-url origin https://github.com/cavneb/airbrake-grails.git
git remote set-url origin --push https://github.com/domurtag/airbrake-grails.git



相同的回购协议。所以当你推动时,下一次获取的结果应该改变 - 显然不会这样。

But I would strongly advice against doing that. I am not sure, but I would assume that this will confuse git a lot, because git assumes that this is the same repo. So when you push, the result of the next fetch should change – which it obviously won’t.

处理您的情况的正确方法是将主repo添加为一个额外的远程(我会称它为上游),并且当你想拉它时,只需要:

The proper way to handle your situation is to add the master repo as an extra remote (I would call it upstream), and when you want to pull it, just do:

git fetch upstream
git merge upstream/master