git下載、安裝、鏈接github

0.下載gitlinux

官網下載速度慢,下載不下來
阿里雲下載地址:https://npm.taobao.org/mirrors/git-for-windows/git


1.安裝gitgithub

linux:
在命令行直接輸入:git,查看結果,有沒有安裝。
若是沒有安裝,sudo apt install gitnpm


2.設置姓名和郵箱及命令行輸出顏色`windows

git config --global user.name "Mike"
git config --global user.email "z_runwei@163.com"
git config --global color.ui autossh


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網站上註冊帳號並登錄ui


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傳輸協議)

git clone 後面的內容到github上覆制想克隆到哪裏就在哪一個文件夾裏右擊,點擊Git Bash Here,再執行以上命令