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:

  1. the bare one to push and pull from
  2. one on Machine A
  3. 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/*
Was it helpful?

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:

https://git.wiki.kernel.org/index.php/GitFaq#My_HTTP_repository_has_updates.2C_which_.27git_clone.27_misses._What_happened.3F

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top