git annex/ssh:ControlPath太长了

Vin*_*nce 11 git ssh git-annex

运行命令时:git annex sync,我收到以下错误:

ControlPath too long
Command ssh ["-S","<local path to git repo>/.git/annex/ssh/git@<git url>","-o","ControlMaster=auto","-o","ControlPersist=yes","git@<git url>","git-annex-shell 'configlist' '<local path to git repo>'"] failed; exit code 255
Run Code Online (Sandbox Code Playgroud)

根据这个,问题不是git而是ssh(但是那里提出的解决方案没有用).

我能做些什么来避免这个问题?

Jak*_*uje 8

"-S","<local path to git repo>/.git/annex/ssh/git@<git url>"
Run Code Online (Sandbox Code Playgroud)

此路径不应超过92个字符,因为unix(7)建议:

在编写可移植应用程序时,请记住,某些实现的sun_path短至92个字节.

如果你知道你在目录结构中潜水太深而且路径会扩展这个限制,那么你可以根据你的man git-anex执行以下任一操作.git/config:

  1. 完全关闭连接共享使用annex.sshcaching=off.警告:这将显着增加执行所有操作所需的时间和资源!

  2. 使用指定您自己的共享连接路径 annex.ssh-options="-S=~/.ssh/control-%l.%r@%h:%p" -oControlMaster=auto