I m试图操作gitlin
,而没有核对存放处的钥匙。 我可以这样说:
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host
是否有办法将同样的 options子选项传给威恩指挥?
Edit:我可以限制修改~/ssh/config
。 或该机器上的任何其他档案。
I m试图操作gitlin
,而没有核对存放处的钥匙。 我可以这样说:
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host
是否有办法将同样的 options子选项传给威恩指挥?
Edit:我可以限制修改~/ssh/config
。 或该机器上的任何其他档案。
Add them to your ~/.ssh/config
:
Host host
HostName host
User user
SshOption1 Value1
SshOption2 Value2
<代码>Host的条目是你在指挥线上具体说明的内容,<代码>HostName是真正的东道名称。 它们可以是相同的,也可以是<代码>Host的条目。 如果你没有具体规定指挥线上的<编码>用户@,则使用<代码>User。
If you must configure this on the command line, set the GIT_SSH
environment variable to point to a script with your options in it.
最近公布的第2.3类支持新的变量“GIT_SSH_COMMAND”,可用于确定指挥参数。
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone user@host
$GIT_SSH_COMMAND
takes precedence over$GIT_SSH
, and is interpreted by the shell, which allows additional arguments to be included.
为具体指明不同的钥匙而采取的另一种选择是git config core.sshCommand
with git 2.10 + (Q32016)。
这是在
See commit 3c8ede3 (26 Jun 2016) by Nguyễn Thái Ngọc Duy ( A new configuration variable Similar to This is useful for selecting different private keys targetting the
same host (e.g. github) If this variable is set, 这意味着<代码>git lin。 可以: 如欲申请allrepos,130user0959 。pclouds
).
(Merged by Junio C Hamano -- gitster
-- in commit dc21164, 19 Jul 2016)
core.sshCommand
has been added to
specify what value for GIT_SSH_COMMAND to use per repository.$GIT_ASKPASS
or $GIT_PROXY_COMMAND
, we also read from
config file first then fall back to $GIT_SSH_COMMAND
.core.sshCommand:
git fetch
and git push
will use the specified command instead of ssh
when they need to connect to a remote system.
The command is in the same form as the GIT_SSH_COMMAND
environment variable and is overridden when the environment variable is set.cd /path/to/my/repo
git config core.sshCommand ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
# later on
git clone host:repo.git
git config --global core.sshCommand ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
www.un.org/Depts/DGACM/index_spanish.htm 托存级别配置,不影响系统一级环境
Consolidating the already available answers, I am choosing the below steps. This ensures that the configuration changes do not impact at the machine level, but just for the repository being worked on. This is needed in my case as my script needs to be executed on a shared Bamboo agent.
1. 导言 <代码> GIT_SSH_COMMAND approach.
GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone ssh://url
2. 沉浸在贮存库中。
cd repo-dir
3.Set <代码>分数.sshCommand配置,使今后所有电话都能够像往常一样,在内部使用所提供的优惠选择。
git config core.sshCommand ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
例如,如何通过使用全球信息技术——SSH变量通过暗中的论点:
$ echo ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $* > ssh
$ chmod +x ssh
$ GIT_TRACE=1 GIT_SSH="$PWD/ssh" git clone user@host
http://europa-eu-un.org 以上线是你应穿过的终端指挥线。 它创建了一个文件ssh,使之可执行和执行。
如果您愿意通过私人关键选择,请查询。 如何说明哪些私人关键用途?。
我认为,对版本和大体进行更新;=2.3和使用
Host host
HostName host
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
更安全的方式是:
git config --global core.sshCommand ssh -o StrictHostKeyChecking=accept-new
这比<代码>更安全。 缩略语 <代码>no,可互换。
a. 一次性指挥使用:
git -c core.sshCommand= ssh -o StrictHostKeyChecking=accept-new clone ...
这个问题通过在温得克机器中采取后续步骤确定:
在C:用户名下编集。
添加以下一行:
host <HOST>
hostname <HOSTNAME>
user <USER_NAME>
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
port <PORT_NUMBER>
KexAlgorithms +diffie-hellman-group1-sha1
然后再次审判。
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...
I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...
I have a svn repo with various apps as subdirectory of a single svn repo. That worked because I could have checked out a partial, repo. As I cant do that with git obviously I need multiple repos. I ...
I understand how to merge branches together in git, and I love how easy it makes it. I have a branch that looks like this: project/ |--subproj1/ | |---(files) | |--subproj2/ |---(files) A ...
We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...
I get this on every git svn command I try. I am using git version 1.6.4.2 on OS 10.6 The initial git svn fetch works, and i can do further fetches after that, but they do not enter the log or update ...
Given I have a master branch and a other branch. In the other branch are files I don t want to commit (e.g. log files) so I ignored them in .gitignore. When I switch to the master branch, these ...
Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...