0.下載git
官網下載速度慢,下載不下來
阿里雲下載地址:https://npm.taobao.org/mirrors/git-for-windows/
1.安裝git
linux:
在命令行直接輸入:git,查看結果,有沒有安裝。
如果沒有安裝,sudo apt install git
2.設置姓名和郵箱及命令行輸出顏色`
git config --global user.name "Mike"
git config --global user.email "z_runwei@163.com"
git config --global color.ui auto
3.創建 SSH Key
ssh-keygen -t rsa -C "your_email@example.com"
* 顯示:
Generating public/private rsa key pair.
Enter file in which to save the key
(/Users/your_user_directory/.ssh/id_rsa): 按回車鍵
Enter passphrase (empty for no passphrase): 輸入密碼3307086;一般不輸入密碼,直接回車
Enter same passphrase again: 再次輸入密碼
4.在github網站上注冊賬號並登陸
5.在GitHub中添加公開密鑰,今后就可以用私有密鑰進行認證了。
6.測試:
用手中的私人密鑰與GitHub進行認證和通信
ssh -T git@github.com
7.在github建立倉庫
8.在命令行clone倉庫
git clone git@github.com:zrunwei/HelloWorld.git(ssh傳輸協議)
git clone https://github.com/zrunwei/HelloWorld [myHelloWorld](http傳輸協議)