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)

2015-08-13_06-41-50.png

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

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

273 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot