Reputation: 38228
With git status
, I get this message:
On branch master
Your branch and 'origin/master' have diverged, and
have 9 and 2 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean
With git fetch -v origin
, I get
[up to date] master -> origin/master
Aren't the two in contradiction?
Upvotes: 1
Views: 90
Reputation: 48672
git fetch
is telling you that origin/master in your repository and master in the origin repository are the same. git status
is telling you that origin/master in your repository and master in your repository have diverged. There's no contradiction, since they're talking about different things.
Upvotes: 1
Reputation: 26196
There are 3 branches in play here, instead of 2:
master
origin/master
master
git status
is comparing master
and origin/master
(both local branches).
git fetch
, however, is comparing the remote's master
and your local origin/master
.
Upvotes: 2