github上傳與下載,github上傳下載

來源:互聯網
上載者:User

github上傳與下載,github上傳下載
1、建立SSH key

第一次使用github,首先在本地建立ssh key

ssh-keygen -t rsa -C "your_email@youremail.com"  

後面的your_email@youremail.com改為你的郵箱,之後會要求確認路徑和輸入密碼,我們這使用預設的一路斷行符號就行。

成功的話會在~/下產生.ssh檔案夾,進去,開啟id_rsa.pub,複製裡面的key。

回到github,進入Account Settings,左邊選擇SSH Keys,Add SSH Key,title隨便填,粘貼key。類似於:

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA63rye64sOsj3wINkbDKcnEC78bG/Bg0DBS5Q6TZaEglIHTAhszWu/meFuUiUHGpKSzVc29DHeqaM7Jvad3zhcaceu5Bl1OFT7devC0Q3s5k+MYwdIwc/OiiF9MBia5iXxS6N2i7NSEoXjFiS2EcpXPmhn/pljxCIzOhJy2OB3i6VBJJBFYb2BL03/ozOqnI3hKk3o8hpop28UkzKr4f+ObPZDAyI9riXhbu5nnZDqQSzlwv3NDoZOOWm9t8NcEUIeMSSB5+FGY64CPGE85GUop1+2QcVpRBMd2CU3R4NtFllFYwnf9f3uGoXG6IBPBP2EO3KBGXaHj0v83rpqbt+2w== cdkd321@126.com

為了驗證是否成功,在git bash下輸入:

ssh -T git@github.com  

如果是第一次的會提示是否continue,輸入yes就會看到:

You’ve successfully authenticated, but GitHub doesnot provide shell access 

這就表示已成功連上github。

上傳
//or create a new repository on the command lineecho # command >> README.mdgit initgit add README.mdgit commit -m "first commit"git remote add origin git@github.com:xiabodan/command.gitgit push -u origin master
//or push an existing repository from the command linegit remote add origin git@github.com:xiabodan/command.gitgit push -u origin master
下載

第一次下載

git clone https://github.com/xiabodan/DataStructure.git

更新代碼

git pull

聯繫我們

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