-1

I have cloned a repo from Server A to a Server B, which has worked fine. After commiting changes on Server A I am now trying to fetch on Server B those new commits. git fetch however says that master is up to date, despite there being new commits. I have now spent hours trying to find a solution to no avail.

git fetch -v    
From http://git.SERVER-A.com/repos/cms6
= [up to date]      master     -> origin/master

On Server B, doing a git ls-remote results in this:

git ls-remote http://git.SERVER-A.com/repos/cms6.git
Username: 
Password: 
3b6a55c41c10f81fbfbfe64ca3096701c08eba0c        HEAD
3b6a55c41c10f81fbfbfe64ca3096701c08eba0c        refs/heads/master

On server A, doing a git log shows that there are 3 more commits:

064a308 Removed txt file again
615040d Added txt file as a test
c7da65d Added padding to select boxes
3b6a55c Updated database_object
...

git remote show on Server B results in the following, which to me looks correct.

git remote show origin
Username: 
Password: 
* remote origin
  Fetch URL: http://git.SERVER-A.com/repos/cms6.git
  Push  URL: http://git.SERVER-A.com/repos/cms6.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)

Does anyone have an idea what might be the problem?

A few notes, that might give someone a hint:

  • There is only one branch, the master branch
  • Server A, that has the main repo runs git version 2.3.0
  • Server B, from which I'm trying to fetch runs git version 1.7.2.5

1 Answers1

1

You seem to have updated server B's reference to server A's master branch but not merged that reference into server B's master branch.

git pull origin master

on server B 'should' fix this.

A more in depth look at git fetch vs git pull can be found here.

Community
  • 1
  • 1
Sean
  • 333
  • 4
  • 9
  • Thanks, tried running that command, with the following result: ` * branch master -> FETCH_HEAD Already up-to-date.` – fitzcarraldo Apr 19 '15 at 20:23
  • You could try `git merge origin/master` on server B but I suspect that the issue is some due to the old git version on server B. I'd suggest upgrading server B's git and trying again. Later versions of git have several security fixes, so upgrading is generally a good thing to do anyway. – Sean Apr 19 '15 at 20:32