1

Currently my team is using BitBucket as code hosting. By default, we do not fast-forward when merging changes.

Sometime when I'm pulling new changes from BitBucket , a new commit appeared like this

enter image description here

My question is, why this happened in sometime? In most of the time, there is no new commit like this when pulling

Kelvin Low
  • 390
  • 6
  • 22

1 Answers1

0

If your remote branch has evolved (new commit pushed by other), then a pull would by default fetch + merge: hence the new merge commit.

If you want to avoid that, use (since Git 2.6+):

git config --global pull.rebase true
git config --global rebase.autoStash true

Then a regulat pull through Atlassian SourceTree would rebase your local commits on top of the fetch origin/master one, avoiding any new merge commit.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250