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

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 vote

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.

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.

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

428 views 0 1
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you