GitHub SSH 設定流程
1. 產生 SSH Key
ssh-keygen -t ed25519 -C "your_email@example.com"-C "your_email@example.com" 是什麼?
-C "your_email@example.com" 是什麼?ed25519 AAAAC3Nz... your_email@example.com~/.ssh/id_ed25519 # 私鑰(不能分享)
~/.ssh/id_ed25519.pub # 公鑰(可以分享)2. 輸出公鑰內容
3. 加入 GitHub SSH Keys
4. 用 SSH 方式 Clone Repo(最重要)
✔ 正確做法(SSH)
❌ 錯誤(HTTPS,會要求密碼或 token)
5.(WSL 推薦)加入 ssh-agent 以免重開機後失效
啟動 ssh-agent
設為自動執行(建議)
6. 測試 SSH 與 GitHub 是否連線成功
完成!
Last updated