小智 7
将fork2定义为fork1中的远程仓库
git remote add fork2 /path/to/fork2/repo
Run Code Online (Sandbox Code Playgroud)
然后从fork2获取更改
git fetch fork2
Run Code Online (Sandbox Code Playgroud)
从fork2中提取更改.
git pull fork2 <branch name>
Run Code Online (Sandbox Code Playgroud)
需要注意的是,上述命令将更新您当前的分支.所以你应该更好地使用跟踪远程仓库并查看更改,并将其合并到fork1中的分支,如果你没问题的话.
git checkout --track -b branch_fork2 fork2/branch2
Run Code Online (Sandbox Code Playgroud)
查看名为branch_fork2的本地分支中的代码.
检查您想要合并fork2更改的repo.
git checkout feature_1
Run Code Online (Sandbox Code Playgroud)
合并它
git merge branch_fork2
Run Code Online (Sandbox Code Playgroud)
如果它导致合并冲突,解决合并冲突并提交它.