windows下使用命令下載github代碼

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   使用   ar   檔案   art   

github這個就不介紹了,在linux下的話很方便,安裝git及ssh就可以直接下了,但在windows上面呢,問題就來了,說說怎麼下上面的原始碼吧; 安裝cygwin,在安裝cygwin時,選擇git及openssh進行安裝,安裝方法及步驟就不講了,網上一堆,重點關注一下,怎麼下代碼

git串連都需要一個publickey,所以我們要先來產生一個publickey(以下都需要在cygwin中輸入命令)

1 檢測是否已經有了SSH key

ls -la ~/.ssh

檢查顯示的列表中是否有id_rsa.pub及id_dsa.pub,如果沒有則進入第2步,否則跳到第3步

2 產生 一個新的SSH key

ssh-keygen -t rsa -C "[email protected]"  

後面是註冊github時填寫的email,如:ssh-keygen-t rsa -C [email protected];輸入完整的命令後,斷行符號需要輸入一些東西,預設斷行符號就行,最後會出現如下的字串,即產生成功

The key fingerprint is:2c:4d:14:04:89:8f:91:a2:a3:ed:5e:as:6d:2e:6d:0f [email protected]The key‘s randomart image is:+--[ RSA 2048]----+| o . || o + o || . + . + . || . + . . . || o . . S . ||oEo . . . ||+oo. o . ||.... o.. ||. .o |+-----------------+

3 把產生的key加入到github中

登入後,進入這個地址:https://github.com/settings/ssh

把剛才產生的 /home/xxx/.ssh/id_rsa.pub這個檔案開啟,複製裡面所有的內容,添加到SSH-keys中,儲存;

4 驗證是否可以串連成功

ssh -T [email protected]
The authenticity of host ‘github.com (207.97.227.239)‘ can‘t be established.# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.# Are you sure you want to continue connecting (yes/no)?Don‘t worry! This is supposed to happen. Verify that the fingerprint in your terminal matches the one we‘ve provided up above, and then type "yes."# Hi username! You‘ve successfully authenticated, but GitHub does not# provide shell access.

顯示這些說明已經串連成功;下面就是clone代碼了,這個簡單:

git clone xxxx後面是要下代碼的地址;好了,在github上下代碼的講簡就此結束,不知道有沒有寫清楚;

參考:https://help.github.com/articles/generating-ssh-keys

 

windows下使用命令下載github代碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.