Win7下Git SSH 建立Key

前提:裝好git,打開git bash。git

一、進入.ssh文件夾:cd ~/.ssh/bash

  若是沒有這個文件夾,本身建立一個:mkdir ~/.ssh  ssh

二、設置git全局的name和email,若是事先已經配置過了,就不用再配置了。rem

  git config --global user.name "yourname"
  git config --global user.email "youremail@mail.com"it

三、生成你的key:  ssh-keygen -t rsa -C "youremail@mail.com"email

  過程當中須要回車幾回,成功後會獲得兩個文件:id_rsa和id_rsa.pub。配置

  文件位置:C:\Users\Administrator\.ssh  跟你的不必定徹底同樣rsa

四、用記事本打開id_rsa.pub,複製裏面的所有內容到git上的key粘貼就好了。ssh-key

相關文章
相關標籤/搜索