Git pull not updating, repo inconsistent?
Question
I have a strange problem with git configured using DAV on apache2.
I'll provide more details, if needed, but here is a high-level overview of the problem.
I have 3 clones of a repository:
- the bare one to push and pull from
- one on Machine A
- one on Machine B
I do 1 last change on Machine A, and I pushed all my changes, and did a pull on both. The problem is, for some reason I don't see my last changes after pulling on Machine B.
There is no message about being ahead of remote on either machine either.
The weird part is:
- If I do a "git log" on the bare repository, the last changes from Machine A will be there
- If I do another clone of the bare repository, the changes won't be there. It will only be up to the last changes that Machine B sees.
Is this a server configuration issue or a git issue? I've had this problem for many months now.
git branch -a
prints:
Machine A:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
Machine B:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
.git/config
for both:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "origin"]
url = http://<url>/p/home.git
fetch = +refs/heads/*:refs/remotes/origin/*
Solution
Since you've confirmed my guess was right in the comments, I'll add this as an answer :) It sounds like the problem is the one described in this git FAQ:
There's a sample hook called post-update.sample in .git/hooks/ that you can rename to post-update in order to automatically run git update-server-info
after a push. This generates information needed by the dumb HTTP transport.