tRuEsAtM
tRuEsAtM

Reputation: 3678

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?

Upvotes: 1

Views: 435

Answers (1)

VonC
VonC

Reputation: 1326776

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

Upvotes: 1

Related Questions