Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 从USB自定义SSH_Git_Ssh - Fatal编程技术网

Git 从USB自定义SSH

Git 从USB自定义SSH,git,ssh,Git,Ssh,我有一个项目我正在从一个USB插入到一个公共计算机上工作。我希望通过这个USB专门设置一个自定义SSH配置文件(即,不更改用户主目录中的SSH配置)。我希望在USB上的工作目录中有一个SSH配置文件,但我不知道这是否可行 (顺便说一句,我的总体目的是在项目的工作目录中为git repo设置自定义ssh选项)我相信您知道 ssh -F /path/to/USB/worktree/ssh_config 所以你可以利用它,例如 alias ssh=`ssh -F /path/to/USB/workt

我有一个项目我正在从一个USB插入到一个公共计算机上工作。我希望通过这个USB专门设置一个自定义SSH配置文件(即,不更改用户主目录中的SSH配置)。我希望在USB上的工作目录中有一个SSH配置文件,但我不知道这是否可行


(顺便说一句,我的总体目的是在项目的工作目录中为git repo设置自定义ssh选项)

我相信您知道

ssh -F /path/to/USB/worktree/ssh_config
所以你可以利用它,例如

alias ssh=`ssh -F /path/to/USB/worktree/ssh_config`
在交互式shell中

但是,请注意,您已经可以设置特定于回购协议的选项,例如

  ; Proxy settings
  [core]
          gitproxy="ssh" for kernel.org
          gitproxy="ssh -i ../some_pubkeyfile" for our_shared_repo.our_company.dk
          gitproxy=default-proxy ; for all the rest

您不仅可以为某些主机设置它,还可以为每个工作树配置
.git/config

我相信您知道

ssh -F /path/to/USB/worktree/ssh_config
所以你可以利用它,例如

alias ssh=`ssh -F /path/to/USB/worktree/ssh_config`
在交互式shell中

但是,请注意,您已经可以设置特定于回购协议的选项,例如

  ; Proxy settings
  [core]
          gitproxy="ssh" for kernel.org
          gitproxy="ssh -i ../some_pubkeyfile" for our_shared_repo.our_company.dk
          gitproxy=default-proxy ; for all the rest

您不仅可以为某些主机设置它,还可以为每个工作树配置
.git/config

非常感谢!gitproxy究竟是如何工作的?我应该能够为某些远程设备指定自定义ssh命令吗?老实说,我自己还没有使用gitproxy设置。但是当我搜索
mangitconfig
查找
ssh
时,它跳了起来,非常感谢!gitproxy究竟是如何工作的?我应该能够为某些远程设备指定自定义ssh命令吗?老实说,我自己还没有使用gitproxy设置。但在搜索
mangitconfig
查找
ssh