14

We use Github for source control in our organization. Multiple developers continuously merge their changes to remote source repository. In my case I cloned the repository when two weeks back and there were multiple merges after that. Now I am trying to get the latest revision of the code using.

git pull origin master

I for sure know that there were multiple merges that have gone in since last time I cloned but pull command tells me that its already up to date. Am I missing anything here?

Holger Just
  • 52,918
  • 14
  • 115
  • 123
Ram
  • 3,034
  • 11
  • 38
  • 46

5 Answers5

19
git reset --hard HEAD~20 # some large number
git pull origin master

This fixed my problem with an un-pullable update. The idea is to push HEAD back far enough to clear up any confusion for git. Then make the desired pull.

joel3000
  • 1,249
  • 11
  • 22
3

One explanation would be that the latest commits have been done on another branch, as explained in "Git pull from my public repository not working".

The other possibility is for you to be in a detached HEAD mode.
That would make any git pull "up-to-date" since you are in any branch.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

I used Team Explorer from my Visual Studio application and was able to Sync, Fetch, and Pull. That finally worked.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Tien
  • 159
  • 1
  • 3
  • 10
1

For me, nothing seemed to work and I had to clone the repository from GitHub again. As a last resort that might be an option.

gignu
  • 1,763
  • 1
  • 14
  • 24
  • If all other things fail, you can avoid needing to clone the entire repo by going to a different branch, deleting the problematic one, running `git fetch` and then changing back to it. – shapiro yaacov May 14 '23 at 09:21
1

For me the solution was:

from the current branch I executed git pull origin ${current-branch-name} in my specific case the complete command was:

From develop branch: git pull origin develop

The git reset --hard HEAD and git pull origin HEAD commands do not work for me.