从Windows Cmd行运行git:关键文件在哪里? [英] Running git from Windows Cmd line: Where are key files?
问题描述
在bash shell中,我用 ssh-keygen
- 一切正常。
关键文件位于我的%userprofile%\.ssh
文件夹中(来自bash shell,它是:〜/ .ssh
)。
我能够连接到我的服务器(在我的情况下是不受干扰的) 。
接下来,我希望能够从Windows Cmd shell运行git。
添加 c:\\ \\ msysgit \bin
和 c:\msysgit\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\在本地工作 就好:分支,合并,添加,提交,结帐,......运行良好。
Permission denied(publickey)。
'它看起来像git,当从命令行执行时看着不同的位置尝试分配密钥文件,或导致其失败的其他原因。
要使mysysgit命令行找到.ssh键,您需要使用%HOME%
指向包含.ssh文件夹的目录
通常您可以做
set HOME =%USERPROFILE%
So I've installed msysgit, and run git successfuly from the bash shell.
From within the bash shell, I've created keys with ssh-keygen
- everything works fine.
Key files are in my %userprofile%\.ssh
folder (from the bash shell, it is: ~/.ssh
).
I'm able to connect to my server (unfuddle in my case).
Next, I do want to be able to run git from the Windows Cmd shell.
Adding c:\msysgit\bin
and c:\msysgit\mingw\bin
to the search path.
Git is working locally just fine: branch, merge, add, commit, checkout, ... working well.
However, trying to work with the server fails, with: 'Permission denied (publickey).
'
It looks like git, when executed from command line looks at a different location trying to allocated the key files, or another reason causing it to fail.
To get the mysysgit command line to find the .ssh keys you'll need to have %HOME%
point to the directory containing the .ssh folder
Often you can just do
set HOME=%USERPROFILE%
这篇关于从Windows Cmd行运行git:关键文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!