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

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

Ted Singh August 12, 2015

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

5 votes
Johannes Kilian
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.
August 12, 2015

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

0 votes
Ted Singh August 14, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events