当运行命令: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
根据 this ,问题不是 git,而是 ssh(但那里提出的解决方案没有用)。
我能做些什么来避免这个问题?
最佳答案
"-S","<local path to git repo>/.git/annex/ssh/git@<git url>"
此路径不应超过 92 个字符,如 unix(7)建议:
When coding portable applications, keep in mind that some implementations have sun_path as short as 92 bytes.
如果您知道您对目录结构的了解太深并且路径会扩展此限制,您可以根据 man git-anex 执行以下操作之一。在你的 .git/config
中:
使用
annex.sshcaching=off
完全关闭连接共享。 警告:这将显着增加执行所有操作所需的时间和资源!使用
annex.ssh-options="-S=~/.ssh/control-%l.%r@%h:%p"-oControlMaster= 为共享连接指定你自己的路径自动
关于git 附件/ssh : ControlPath too long,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32393622/