github在windows上生成ssh密钥 [英] github generate ssh key on windows

查看:135
本文介绍了github在windows上生成ssh密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 7旗舰版,git版本1.8.0.msysgit.0



我按照以下说明生成ssh密钥: https ://help.github.com/articles/generating-ssh-keys

  $ clip< ; 〜/ .ssh / id_rsa.pub 
#将id_rsa.pub文件的内容复制到剪贴板中

'<'运算符保留供将来使用。
在行:1 char:7
+ clip< <<<< 〜/ .ssh / id_rsa.pub
+ CategoryInfo:ParserError:(<:OperatorToken)[],ParentContain
sErrorRecordException
+ FullyQualifiedErrorId:RedirectionNotSupported


解决方案

正如我在 git.exe位于何处? GitHub for Windows 中,您有使用此应用程序为您安装的便携式git。



您需要打开bash git会话才能使用ssh命令。



这些设置允许您定义一种你想要的外壳




GH4W是Git和GitHub应用程序的沙盒安装,它负责所有的配置。请注意,如果您有现成的Git环境,它不会混淆您的现有环境。你的机器上会安装两个快捷方式,一个用于GH4W应用程序,另一个用于标记Git Shell。



Git Shell快捷方式根据配置启动所选择的shell在GH4W应用程序的选项菜单中。您也可以从应用程序中为任何给定的存储库启动shell。



默认情况下,这是PowerShell,但您可以将其更改为Bash,Cmd或甚至自定义选项。

选择Git Bash,您应该可以执行脚本。


Windows 7 Ultimate , git version 1.8.0.msysgit.0

I'm following these directions to generate an ssh key : https://help.github.com/articles/generating-ssh-keys

$clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard

The '<' operator is reserved for future use.
At line:1 char:7
+ clip < <<<<  ~/.ssh/id_rsa.pub
    + CategoryInfo          : ParserError: (<:OperatorToken) [], ParentContain
   sErrorRecordException
    + FullyQualifiedErrorId : RedirectionNotSupported

解决方案

As I mention in "Where is git.exe located?" within GitHub for Windows, you have a portable git installed for you with this application.

You need to open a bash git session in order to use ssh commands.

The settings allow you to define the kind of shell you want:

GH4W is a sandboxed installation of Git and the GitHub application that takes care of all that configuration. Please note, it will not mess with your existing Git environment if you have one. There will be two shortcuts installed on your machine, one for the GH4W application and another labeled "Git Shell".

The Git Shell shortcut launches the shell of your choice as configured within the GH4W application’s options menu. You can also launch the shell from within the application for any given repository.

By default, this is PowerShell but you can change it to Bash, Cmd, or even a custom option.

Choose Git Bash and you should be able to execute your script.

这篇关于github在windows上生成ssh密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆