I have a commit with 1 ahead
and 6 behind
.
What should I do in this situation?
I think, that solution might be like this:
git push
and after
git pull
But I think, it can solve only Behind
.
Maybe I am wrong.
-------*------*-----*-----*-----B
\
\
\
*-------A
I make my part and change sdk.
Now I want to merge with B
.
git pull
(or rather, the git merge
part that pull
does) will "solve" both 'ahead' and 'behind'.
branch is X commits behind means that there are X new (unmerged) commits on the branch which is being tracked by your current branch.
branch is X commits ahead analogously means that your branch has X new commits, which haven't been merged into the tracked branch yet.
Once you've pulled (thereby merging the remote changes into your local ones) and pushed (thereby publishing your changes and the merge to the remote), your own branch and the remote branch will point to the same commit, so neither is ahead or behind.