git 附件/ssh : ControlPath too long

标签 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

根据 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 中:

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

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

关于git 附件/ssh : ControlPath too long,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32393622/

相关文章:

git - 保存 ssh key 失败

php - 如何让apache做ssh

amazon-web-services -/var/www/html目录和/www作为根目录的区别

GitHub 的 Git 附件?

svn - 同步 Git 和 Svn

Git 忽略陌生事物

git - 使用 LibGit2Sharp 截断 GIT 提交历史

ssh - Openshift for Play : The remote end hung up unexpectedly

windows - Windows 上的 Git 附件安装

git - 什么是 git-annex 的良好工作流程?