简体   繁体   中英

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. We have a master branch and some feature branches. When a feature is released that branch is merged into 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?

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 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)

git checkout master
git merge --no-ff
git push
git checkout myFeatureBranch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM