用Git上傳專案到GitHub上
官方文件: ofollow,noindex">https://help.github.com/articles/connecting-to-github-with-ssh/
1 建立新ssh key ssh-keygen -t rsa -b 4096 -C "[email protected]"

2 後臺開啟ssh-agent eval "$(ssh-agent -s)"

3 新增私鑰到ssh-agent ssh-add -K ~/.ssh/id_rsa_handy9420

4 檢視公鑰 cat ~/.ssh/id_rsa_handy9420.pub

5 更新GitHub的SSH keys

6 檢測是否配置成功: ssh -T [email protected]

7 檔案上傳到gitHub中
參考文章: https://www.cnblogs.com/specter45/p/github.html#s3
git init //把這個目錄變成Git可以管理的倉庫 git add README.md //檔案新增到倉庫 git add . //不但可以跟單一檔案,還可以跟萬用字元,更可以跟目錄。一個點就把當前目錄下所有未追蹤的檔案全部add了 git commit -m "first commit" //把檔案提交到倉庫

注意提前在GitHub上建立倉庫,不要勾選README.md。
git remote add origin [email protected]:handy9420/test.git //關聯遠端倉庫 git push -u origin master //把本地庫的所有內容推送到遠端庫上

圖上的錯誤是因為勾選了README.md,解決辦法是: git push --all -f

注意:
- git是不能管理空的資料夾的,資料夾裡必須有檔案才能add。
- 第一次用
git push -u origin master
後續用git push origin master