Reputation: 15351
Suppose two checkouts of a remote repository exist. When doing a commit/push in eGit from the first local repo and then a pull from second local repo, eGit shows a dialogue confirming the commit that is being pulled but in the editor, changed files' contents do not update.
My understanding is that git pull does the merge as well so files in the working directory should be updated. Is this incorrect? What additional step(s) do I need in Eclipse eGit to have the files update content.
Upvotes: 3
Views: 1484
Reputation: 15351
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)
Upvotes: 1