2

Github says, "This branch is 10 commits ahead, 8 commits behind xyz:master".

How do I make it even with the master?

Sajib Khan
  • 22,878
  • 9
  • 63
  • 73
Anagh Hegde
  • 327
  • 2
  • 14

2 Answers2

2

Pull master into your branch (say, feature) then solved "8 commits behind". And if you merge feature with master then "10 commits ahead" would be solved.

# merge 'master' into 'feature' branch (solve '8 commits behind')

$ git fetch
$ git checkout feature 
$ git pull origin master         # pull latest commits of master
$ git push origin HEAD           # update remote/feature

# merge 'feature' into 'master' branch (solve '10 commits ahead')

$ git checkout master            # checkout 'master'  
$ git pull origin master         # sync with origin/master
$ git pull origin feature        # pull latest commits of your branch 'feature'
$ git push origin master         # push to remote/master
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73
-2

Merge the two branches together

Snackoverflow
  • 736
  • 9
  • 31