git - Git-receive-pack 致命
问题描述
我已经在 linux ssh 服务器后面设置了一个 git 存储库。存储库位于/home/git/mimpi.git
. 用户 git 的登录 shell 是/usr/bin/git-shell
pub/priv
ssh 密钥,已在client/server
侧面设置和测试。
现在我正在尝试使用 验证设置git-receive-pack
,但它总是以fatal: bad argument
.
kalou@client:~$ ssh git@0 git-receive-pack mimpi.git
Enter passphrase for key '/home/kalou/.ssh/id_rsa':
fatal: bad argument
我试图在 mimpi.git 周围加上单引号,但没有成功(https://github.com/dulwich/dulwich/issues/365)
我试图运行strace -f sshd
以跟随执行git-shell
,但在之后没有发现任何有意义的东西:
17882 execve("/usr/bin/git-shell", ["git-shell", "-c", "git-receive-pack /home/git/mimpi"...], [/* 9 vars */]) = 0
和之前fatal: bad argument" ...
有任何想法吗?
解决方案
git-shell
做非常有限的取消引用。您应该只用单引号引用您的存储库:
$ ssh git@0 "git-receive-pack 'mimpi.git'"
我不确定您是否应该完全像这样使用 ssh 来执行此操作,但至少在本地运行 git shell 会以这种方式成功:
git shell -c "git-receive-pack '.'"
..lists references...
推荐阅读
- autodesk-forge - Forge 配置器发明者添加自定义扩展
- sql - 员工多于一项津贴的处理
- sql - MySQL Workbench 1:CN 关系
- webgl - 使用 Emscripten 的 SDL 进行 WebGL 渲染对于 sRGB 感知代码来说太暗了
- json - Clojure json 比较
- python - 将范围内python函数的输出/部分响应合并到一个表中
- laravel - barryvdh/laravel-dompdf 呈现空白网页
- ruby - 使用本机扩展安装 Ruby gem
- javascript - 如何在 Strapi 中创建插件
- android - 为什么 appcenter 分析没有立即显示跟踪来自 android 应用程序的事件?