![SSHFS 上的 Git 存储库:无法附加到“.git/logs/HEAD”:参数无效](https://linux22.com/image/116858/SSHFS%20%E4%B8%8A%E7%9A%84%20Git%20%E5%AD%98%E5%82%A8%E5%BA%93%EF%BC%9A%E6%97%A0%E6%B3%95%E9%99%84%E5%8A%A0%E5%88%B0%E2%80%9C.git%2Flogs%2FHEAD%E2%80%9D%EF%BC%9A%E5%8F%82%E6%95%B0%E6%97%A0%E6%95%88.png)
这是我的错误:
fatal: cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Invalid argument
Etckeeper 一直工作到今天。最近对系统的唯一更改是上游 git 存储库。该.git
目录现在位于 sshfs 挂载上。我现在明白这与问题有关。当 .git 目录从 NFS 挂载切换到 sshfs 挂载时,问题就开始了。
给出错误的命令的完整输出:
[root@pc2 etc]# pacman -R cowsay
checking dependencies...
Packages (1) cowsay-3.03-9
Total Removed Size: 0.03 MiB
:: Running pre-transaction hooks...
(1/3) Performing snapper pre snapshots for the following configurations...
==> root: 182
(2/3) Etckeeper Pre-install
(3/3) Update git tracked list of installed packages
fatal: cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Invalid argument
error: command failed to execute correctly
:: Processing package changes...
(1/1) removing cowsay [#################################################################] 100%
:: Running post-transaction hooks...
(1/4) Etckeeper Post-install
(2/4) Update git tracked list of installed packages
fatal: cannot update the ref 'HEAD': unable to append to '.git/logs/HEAD': Invalid argument
error: command failed to execute correctly
(3/4) Arming ConditionNeedsUpdate...
(4/4) Performing snapper post snapshots for the following configurations...
==> root: 183
请建议下一步。
答案1
当您使用sshfs
挂载目录时,还要指定-o writeback_cache=no
:
sshfs -o writeback_cache=no [user@]host:/dir/ /localdir