Reputation: 419
Yesterday I encountered the following behaviour using the GIT command line (and Eclipse). Via command line I did
git pull origin master
Afterwards Eclipse showed me that my branch is 14 commits ahead of the remote branch
I resetted the branch to the remote branch via
git reset --hard origin/master
I pulled again, same result.
Then I used
git fetch origin master
git pull origin master
I could see some files are updated and in Eclipse develop wasn't ahead of master anymore.
From my understanding git pull should be like a fetch + a merge, meaning that the encountered behaviour is either a bug or a misconfiguration.
Does anybody have an idea what the problem I encountered could be? Or do I get something wrong?
Many Thanks Paul
Upvotes: 2
Views: 3167
Reputation: 1323183
It can depend on the version of EGit (and of your Eclipse), but one way to ensure a full synchronisation of a local branch after a git pull is to do (or even redo in your case) the git pull
from Eclipse itself.
See "Pulling New Changes from Upstream Branch ":
Right-click on a project in the Package Explorer and select
Team > Pull
or right-click on a repository in the Git Repositories view and selectPull
to pull new changes from the upstream branch your local branch is tracking.
This also works if resources are selected from more than one repository.
Upvotes: 1