[英]In Git how to check whether my feature branch has all the changes from master branch following a distributed workflow?
In our organization, we follow distributed version control policy using Git.在我们的组织中,我们使用 Git 遵循分布式版本控制策略。 We have a master branch and some feature branches.
我们有一个主分支和一些功能分支。 When a feature is released that branch is merged into master.
当一个特性被发布时,该分支被合并到 master 中。 How to make sure that other feature branches contain the changes from the master branch after building them?
如何确保其他功能分支在构建后包含来自主分支的更改?
Does Git have any utility for this? Git 对此有任何实用程序吗?
If it is your feature branch, meaning you are the only one working on it, you are supposed to rebase ( git rebase
) it on top of an updated master first (meaning local rebase: you resolve conflicts locally).如果它是你的功能分支,意味着你是唯一一个在它上面工作的人,你应该首先将它(
git rebase
)rebase( git rebase
)放在更新的 master 之上(意味着本地 rebase:你在本地解决冲突)。
git checkout master
git pull # assuming you haven't worked on master
git checkout myFeatureBranch
git rebase master
git push --force # assuming you were the only one working on it
Then you merge it to master (if you add a new feature, the merge is generally non-fast-forward)然后你将它合并到master(如果你添加一个新功能,合并一般是非快进的)
git checkout master
git merge --no-ff
git push
git checkout myFeatureBranch
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.