Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.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
Powershell 为什么Git Shell可以将SSH与HTTP远程源URL一起使用?_Powershell_Github_Ssh_Github For Windows_Git Shell - Fatal编程技术网

Powershell 为什么Git Shell可以将SSH与HTTP远程源URL一起使用?

Powershell 为什么Git Shell可以将SSH与HTTP远程源URL一起使用?,powershell,github,ssh,github-for-windows,git-shell,Powershell,Github,Ssh,Github For Windows,Git Shell,我读过。Muein Muzamil的回答说,要使用SSH,我们必须进行如下配置: remote.origin.url=git@github.com:你的用户名/你的项目.git 也就是说,在正常的Windows PowerShell中,SSH不能与HTTPS一起工作 GitHub for Windows附带Git Shell。它是一个增强的PowerShell,具有一些奇特的功能,包括将SSH与HTTP结合使用的能力。我知道这一点,因为我只是在不需要验证的情况下运行了git push,然后运行了

我读过。Muein Muzamil的回答说,要使用SSH,我们必须进行如下配置:

remote.origin.url=git@github.com:你的用户名/你的项目.git

也就是说,在正常的Windows PowerShell中,SSH不能与HTTPS一起工作

GitHub for Windows附带Git Shell。它是一个增强的PowerShell,具有一些奇特的功能,包括将SSH与HTTP结合使用的能力。我知道这一点,因为我只是在不需要验证的情况下运行了
git push
,然后运行了
git config-l
,以查看我正在使用HTTPS作为远程源url

为什么普通Windows PowerShell需要git@github.com协议,而Git Shell则没有

Windows PowerShell、SSH不适用于HTTPS

这是没有意义的:您使用的是ssh,或者您使用的是https(http和ssl)。一个与另一个“不起作用”

具有您的GitHub帐户凭据,因此它可以使用https url

来自的常规Git shell可以使用https或ssh,但对于ssh,您需要确保:

  • 已定义环境变量
    %HOME%
    (哪个或做什么)
  • 您的
    id\u rsa(.pub)
    private/public
  • 您的
    id\u rsa.pub
    公钥为

“G4W…有您的GitHub帐户凭据,因此它可以使用…HTTPS。”这回答了我的问题。接下来的问题(可能属于它自己的so问题):为什么GitHub for Windows(G4W)创建SSH密钥?安装后,有一个
~\.ssh\github\u rsa
密钥及其
.pub
。G4W是否曾经使用过此功能,还是始终使用HTTPS?我自己的感觉是,GFW在通过
git@github.com
protocol并使用用户名和密码,我们可以使用
git remote set url origin
命令手动控制。您的想法可能是正确的,但
git@github.com
不是协议,宋承宪是。Git创建ssh密钥以通过ssh进行身份验证。验证后,您可以推/拉。@ShaunLuttin这是一个很好的单独问题。我会查的。@VonC我期待着你的回答。