跑过这个页面,几个都喜欢谈论 GIT_DISCOVERY_ACROSS_FILESYSTEM 未设置消息。在我的例子中,我们的系统管理员决定 apache2 目录需要在一个挂载的文件系统上,以防服务器的磁盘停止工作并不得不重建。我用一个简单的 df 命令找到了这个:
--> UBIk <--:root@ns1:[/etc]
--PRODUCTION--(16:48:43)--> df -h
Filesystem Size Used Avail Use% Mounted on
<snip>
/dev/mapper/vgraid-lvapache 63G 54M 60G 1% /etc/apache2
<snip>
为了解决这个问题,我只是将以下内容放在 root 用户的 shell 中(因为他们是唯一需要查看 etckeeper 修订的人:
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
一切都很好……非常高兴。
更多注释:
--> UBIk <--:root@ns1:[/etc]
--PRODUCTION--(16:48:54)--> export GIT_DISCOVERY_ACROSS_FILESYSTEM=0
--> UBIk <--:root@ns1:[/etc]
--PRODUCTION--(16:57:35)--> git status
On branch master
nothing to commit, working tree clean
--> UBIk <--:root@ns1:[/etc]
--PRODUCTION--(16:57:40)--> touch apache2/me
--> UBIk <--:root@ns1:[/etc]
--PRODUCTION--(16:57:45)--> git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
apache2/me
nothing added to commit but untracked files present (use "git add" to track)
--> UBIk <--:root@ns1:[/etc]
--PRODUCTION--(16:57:47)--> cd apache2
--> UBIk <--:root@ns1:[/etc/apache2]
--PRODUCTION--(16:57:50)--> git status
fatal: Not a git repository (or any parent up to mount point /etc/apache2)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
--> UBIk <--:root@ns1:[/etc/apache2]
--PRODUCTION--(16:57:52)--> export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
--> UBIk <--:root@ns1:[/etc/apache2]
--PRODUCTION--(16:58:59)--> git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
me
nothing added to commit but untracked files present (use "git add" to track)
希望这会对某个地方的人有所帮助...-wc