Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SourceTree: How to fix this discrepancy between dev and master branch?

Jirong Hu January 21, 2016

The user has finished a pull request and merged the changes from dev-nickw to master. Now from the screenshot master has 1 commit (that pull request) ahead of dev-nickw.

  1. Is this all right? Do I need to and what's the proper way to sych these two branches?  The user wants to reuse the dev-nickw branch. 
  2. Also what's the different between delete that dev-nickw branch and reuse it?

git.PNG

3 answers

1 accepted

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2016

That is correct. The merge is treated as a commit and that is the one commit shown in master ahead of dev. Code should be the same.

Not sure what you meant in the second question. You don't need to delete the dev branch and recreate it every time. You can just reuse the current branch and continue to use pull requests to send the code to master.

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2016

As Jobin said, your current situation looks great.

With the specific commit set above, the branches should be actually in-sync (identical code). If there had been changes to master, your user could merge from master to dev-nickw. If he does that now, and allows it to be a fast-forward merge, Git will just move the branch reference to commit 210ae0f, which would clearly be in-sync.

0 votes
Tim Crall
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2016

To answer the second question, there would be effectively no difference between continuing to use the branch vs. deleting it and creating a new branch off of develop.  A branch is just a pointer, so deleting it and then recreating it at (effectively) the same point won't make any difference.

Also, just to add to everyone else's answer, had there been any commits on the master branch after dev-nickw branched off, then the fact that his dev branch was behind would have had actual meaning, in which case you would want to either merge the master back into dev-nickw, rebase dev-nickw off of master, or (my recommendation) delete dev-nickw and create a new branch, named after the feature you're working on rather than the developer doing the work.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events