git忽略配置core.ssh命令,但可以与GIT

编程入门 行业动态 更新时间:2024-10-21 11:28:06
本文介绍了git忽略配置core.ssh命令,但可以与GIT_SSH_COMMAND =一起正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想使用配置来设置sshCommand而不是环境变量.但是不起作用 这是发生了什么

I would like to use the config to set sshCommand instead of the environment variable. But does not work Here is what happens

➜ GIT_SSH_COMMAND='ssh -i /var/www/level2.lu/www/git_id_rsa -F /dev/null' git ls-remote From git@github:syn2cat/Level2.lu.git fcaa5a2e63499568dd916e7b18f950b311781bd0 HEAD fcaa5a2e63499568dd916e7b18f950b311781bd0 refs/heads/master a542061a64d3698d5da54d63456b26932fe549a2 refs/pull/1/head ➜ git config core.sshcommand ssh -i /var/www/level2.lu/www/git_id_rsa -F /dev/null ➜ git ls-remote Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

并且进行调试,它不使用core.sshCommand中的值

And debugging, it does not use the value from core.sshCommand

➜ GIT_TRACE=1 git ls-remote 13:46:15.366401 git.c:344 trace: built-in: git 'ls-remote' 13:46:15.366564 run-command.c:334 trace: run_command: 'ssh' 'git@github' 'git-upload-pack '\''syn2cat/Level2.lu.git'\'''

版本

➜ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial ➜ git --version git version 2.7.4

推荐答案

core.sshCommand选项已添加到 git 2.10.0 .您正在运行2.7.4,但没有该功能.如果要使用它,则需要升级到较新的Git.

The core.sshCommand option was added to git 2.10.0. You're running 2.7.4, which doesn't have that functionality. You'd need to upgrade to a newer Git if you wanted to use it.

更多推荐

git忽略配置core.ssh命令,但可以与GIT

本文发布于:2023-10-26 23:36:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531673.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令   core   git   GIT   ssh

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!