score:1

Accepted answer

i'm closing this question as invalid since i figured this was due to a misconfiguration of remote tracking on the 2nd local repo. after fixing it, file contents is updated after a pull as expected. thanks all of you for your input.

however the fetch/push specs were ok on both sides, remote tracking was incorrect, i.e. in .git/config in the [branch "my_branch"] sections i got the wrong merge spec for the 2nd local repo so that's why pull didn't merge with the local branch i expected.


some more details about the problem and the fix: like i said, fetch and push specs were ok but as i set up local branches and their tracking on the 2nd machine, i must have made a mistake. in case of the first machine it was correct. in .git/config i saw

[branch "master"]
        remote = origin
        merge = refs/heads/master
[branch "1.3.0"]
        remote = origin
        merge = refs/heads/1.3.0
[branch "1.3.0-devel"]
        remote = origin
        merge = refs/heads/1.3.0-devel

however, on the 2nd machine i probably mistyped the commands to create branches and set up tracking so in git branch -t my_branch_1 origin/my_branch_1 repeated for a number of branches all of which i wanted to track the remote branch with the same name, branch names did not match so i ended up with config something like this

[branch "master"]
        remote = origin
        merge = refs/heads/1.3.0-devel
[branch "1.3.0"]
        remote = origin
        merge = refs/heads/master
[branch "1.3.0-devel"]
        remote = origin
        merge = refs/heads/1.3.0

the transaction i referred to in the question happened on the 1.3.0-devel branch: i committed and pushed into origin/1.3.0-devel from the 1st machine, but because on the 2nd 1.3.0-devel did not track origin/1.3.0-devel, pull didn't merge with teh currently checked out 1.3.0-devel local branch.

i fixed this by issuing the command git branch --set-upstream 1.3.0-devel origin/1.3.0-devel and repeating this for all other branches. (note, this is for git version 1.7.x. for 1.8.x it is different)


Related Query

More Query from same tag