Matthew The Terrible
Matthew The Terrible

Reputation: 1643

VSTS GIT - PR from master -> dev

Whenever I merge master branch down to development branch (or vice vs.) in VSTS git integration I keep seeing the same changes that were already merged. So for instance this morning I merged changes from master back to development. Merged, and then created another PR from master to development again and those same changes are showing in the PR again. Shouldn't there be no changes between the branches now?

I'm not sure what I'm doing wrong, or what screen shots could be helpful here.

Upvotes: 0

Views: 51

Answers (1)

Marina Liu
Marina Liu

Reputation: 38106

After finish merging master into development branch, then you merge development branch back into master branch, the code of the two branches will be same.

Assume the branch structure looks as below graph after merging master branch into development branch:

A---B---C---D---H   development
     \         /
      E---F---G     master

Then if you create another PR to merge development back into master by VSTS, VSTS will use create another commit by default as commit I in below graph instead of using commit H even it’s fast forward merge (git merge master --no-ff):

A---B---C---D---H      development
     \         / \
      E---F---G---I    master

But it’s not influence master branch sync with development branch.

If you want master branch point to the same commit as development branch (as H in below graph):

A---B---C---D---H   development, master
     \         / 
      E---F---G

You can merge development into master locally (git checkout master and git merge development) and then push local master to remote, then both development branch and master branch will point to the same commit H.

Upvotes: 1

Related Questions