系統重裝後如何重新pull自己GitHub上的倉儲

來源:互聯網
上載者:User

由於系統重起了,當然本地的倉儲和SSH產生的密鑰就都沒有了,這時如何在本地pull自己在GitHub上的倉儲呢?

由於系統重裝,~/.ssh檔案肯定就沒有了,這時候就需要重建公開金鑰和密鑰,

ssh-keygen -t rsa -C "your_email@example.com"Generating public/private rsa key pair.
Enter file in which to save the key (/home/XXX/.ssh/id_rsa):
Created directory '/home/XXX/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/XXX/.ssh/id_rsa.
Your public key has been saved in /home/XXX/.ssh/id_rsa.pub.
The key fingerprint is:
79:3c:8c:e7:3e:57:8a:59:36:4d:4c:09:59:d3:8b:df your_email@example.com
The key's randomart image is:
+--[ RSA 2048]----+
|            .+oo |
|            . o..|
|            o. .|
|        =  .o. |
|        S *  o. .|
|        + .+ o.E|
|          .= +  |
|        .+ o    |
|          .o    |
+-----------------+

需要輸入時直接enter,命令列中的郵箱是你在GitHub上留的郵箱,這樣就組建類型為rsa的金鑰組。然後把id_rsa.pub裡的公開密鑰拷貝到GitHub上即可。Account Setting—>SSH Keys—>Add SSH Key即可。最後用ssh -T git@github.com驗證。輸出

Hi XXX! You've successfully authenticated, but GitHub does not provide shell access.即說明設定成功。

其實這些都跟正題沒有什麼關係,設定SSH只是訪問GitHub的一種方式,平常我們使用http的方式是最多的,言歸正傳,當我們需要GitHub上的倉儲時,我們建立一個檔案夾,首先git init初始化git,然後git pull https://github.com/XXX/Snake.git,這樣就會把倉儲拷貝下來,這樣就可以操作了。

推薦閱讀:

如何在 GitHub 建立組織

GitHub Linux下使用方法

Windows下Eclipse搭建GitHub開發環境圖文教程

R語言 3.0.1 源碼已經提交到 GitHub

從GitHub將Maven項目匯入Eclipse4.2

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.