如何将另一个开发人员的分支合并到我的分支中? [英] How do I merge another developer's branch into mine?
问题描述
我对git比较陌生.我们的组织使用 Fork&拉模型,用于管理对master分支的更改.每个开发人员都会在添加新功能时分叉母版,并从其分支中分支.我关注其他开发人员在其自己的分支中所做的提交,有时希望将这些更改合并到我自己的分支中.我应该采取什么步骤来实现这一目标?
I am relatively new to git. Our organization uses a Fork & Pull Model for managing changes to the master branch. Each developer forks the master and branches from their fork when adding new features. I keep an eye on commits that other developers are making in their own branches, and would sometimes like to merge these changes into my own branch. What steps do I take to accomplish this?
推荐答案
您首先需要将其他开发人员存储库添加为远程存储.
You first need to add the other developer repository as a remote.
git remote add otherrep uriToOtherRep
然后您从那里获取更改
git fetch otherrep
然后将分支从远程存储库合并到您的
And then you merge the branch from the remote repository into yours
git merge otherrep/branchname
合并愉快!
这篇关于如何将另一个开发人员的分支合并到我的分支中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!