简体   繁体   English

在 Git 中,如何按照分布式工作流程检查我的功能分支是否具有来自主分支的所有更改?

[英]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.

相关问题 git beanstalkapp暂存分支具有master分支的所有更改,但master暂存没有所有更改 - git beanstalkapp staging branch has all changes from master branch but master doesn't have all changes from staging git pull origin master 标记从 master 更改为在我的功能分支中修改 - git pull origin master marks changes from master as modified in my feature branch 如何将最新的更改从主分支转换为功能分支? - How to get latest changes from master branch into feature branch? 如何在git中将更改从master合并到我的分支 - How to merge changes from master to my branch in git 使用Git功能分支工作流程,何时更新主分支? - With Git feature branch workflow, when do you update the master branch? git 问题:继续将主分支更改拉入从功能分支分支出来的单个开发分支是否更好? - git question : is it better to keep pulling master branch changes into individual dev branch branched out from a feature branch? 将 git 分支的更改恢复到主分支 - Revert changes from a git branch to the master branch 功能分支的Git工作流程 - Git Workflow for Feature Branch Git 特性分支工作流程 - Git feature branch workflow 如何从主分支拉到特性分支而不丢失特性分支中的更改 - How to pull from a master branch into a feature branch without losing changes in the feature branch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM