How to resolve when master is behind origin/master and develop branches

New to git and SourceTree, but I tried using GitFlow and I now see that master (local?) says that it is 11 behind origin/master and develop. How do I sync up everything or do I need to?

image2015-8-12 17:20:42.png

I freely admit that I need to learn git - but any help to clear things up is appreciated.

2 answers

That's a typical situation in development, having a colleague pushing some changes to the remote repository since you have cloned the repository - so your local repository is now "behind" the remote repository (that means: the remote repository (named "origin") is a few commits ahead your local repository)

The command you need is "git pull" (or "git fetch") - which pulls the commits from the remote repository into your local repository ...

  • git fetch: fetches the changes into your local repository only; you have to merge the changes by a subsequent "git merge".
  • git pull: fetches the changes, merges them and commits the changes (if there are no conflicts during merge) into your local repository. (That's the method I would recommend for beginners)


Thanks for the excellent answer - my problem resolved - and I learned something too!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,224 views 4 2
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