2

In git, is it possible to merge the master of a fork to the main repo but only as a new branch? That way nothing really gets replaced and it's easier to go back since it's in a separate branch.

4

3 回答 3

3

您只需要将 fork 的 master 分支作为单独的分支提取到主 repo。例如

cd /path/to/master
git fetch /path/to/fork master:fork
于 2013-01-10T21:54:55.450 回答
1

将 Master 推送到新的 Refspec

在 Git 中,分支只是一个 refspec,因此您可以将任何 refspec 推送到任何其他 refspec。例如:

git checkout master
git push origin master:copy_of_master
于 2013-01-10T21:49:13.580 回答
0

将叉子添加为遥控器并执行此操作,仅git checkout -b branchname remotename/master此而已。

于 2013-01-10T21:51:07.060 回答