簡體   English   中英

Git pull 不更新,repo 不一致?

[英]Git pull not updating, repo inconsistent?

我在 apache2 上使用 DAV 配置 git 有一個奇怪的問題。

如果需要,我將提供更多詳細信息,但這里是問題的高級概述。

我有一個存儲庫的 3 個克隆:

  1. 裸露的推拉
  2. 機器 A 上的一個
  3. 機器 B 上的一個

我在機器 A 上進行了最后一次更改,並推送了所有更改,並對兩者進行了拉動。 問題是,出於某種原因,我在啟動機器 B 后看不到我的最后更改。

也沒有關於在任何一台機器上領先於遠程的消息。

奇怪的部分是:

  • 如果我在裸存儲庫上執行“git log”,則機器 A 的最后更改將在那里
  • 如果我對裸存儲庫進行另一個克隆,則更改將不存在。 它只會取決於機器 B 看到的最后一次更改。

這是服務器配置問題還是 git 問題? 我已經有這個問題好幾個月了。

git branch -a打印:

機器A:

* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

機器B:

* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

.git/config兩者:

[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/*

由於您已在評論中確認我的猜測是正確的,因此我會將其添加為答案:) 聽起來問題出在此 git 常見問題解答中描述的問題:

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

.git/hooks/ 中有一個名為 post-update.sample 的示例掛鈎,您可以將其重命名為 post-update,以便在推送后自動運行git update-server-info 這會生成啞 HTTP 傳輸所需的信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM