登入區塊
主選單區塊

FAQ-問題與解答

主頁 »» github

內容列表




 
此篇文章為網友個人意見,不代表本站立場.
發表者 樹狀展開
jetbomb
發表日: 2026-04-30 19:10  更新: 2026-04-30 19:10
網站管理員
註冊日: 2025-10-24
來自: MCSD HUI HUA PENG
發表數: 383
 驗證
🔑 GitHub SSH 工作流(一次到位)
1. 產生金鑰(只要做一次)
bash
ssh-keygen -t ed25519 -C "你的GitHub信箱"
會生成:

私鑰:~/.ssh/id_ed25519

公鑰:~/.ssh/id_ed25519.pub

2. 加到 GitHub 帳號
登入 GitHub → Settings → SSH and GPG keys → New SSH key

貼上公鑰內容:

bash
cat ~/.ssh/id_ed25519.pub
3. 啟動 SSH Agent 並載入金鑰
bash
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
4. 測試連線
bash
ssh -T git@github.com
成功會顯示:

程式碼
Hi <你的GitHub帳號>! You've successfully authenticated, but GitHub does not provide shell access.
5. 改用 SSH URL
錯誤的 HTTPS 方式:

bash
git clone https://github.com/Sanster/ComfyUI-RMBG.git
正確的 SSH 方式:

bash
git clone git@github.com:Sanster/ComfyUI-RMBG.git
6. 如果已經 clone 下來(remote 還是 HTTPS)
進入專案目錄,改成 SSH:

bash
cd ComfyUI-RMBG
git remote set-url origin git@github.com:Sanster/ComfyUI-RMBG.git
7. 測試 push
bash
git pull
git push
若能正常執行,就代表 SSH 驗證已經永久生效。

🎯 結果
一次設定好後,GitHub 會永久認得你的電腦。

不需要再每次重新申請或輸入 Token。

之後所有 git pull、git push 都會直接通過。
回應
待審區塊
誰在線上區塊
線上目前共1
(1人在瀏覽FAQ-問題與解答)

會員: 0
訪客: 1

尚有...
搜尋區塊
新會員區塊
TaylaZarat 2026-06-27
LatashiaDi 2026-06-27
ErnestHowe 2026-06-27
LynetteKei 2026-06-26
EdytheBinf 2026-06-26
LucieKiek1 2026-06-24
FrancisSou 2026-06-24
CaraDavids 2026-06-24
BennettGai 2026-06-24
GeraldineM 2026-06-24
Powered by   XOOPS 2.0.6 繁體中文版 release 20040222 © 2001-2003 The XOOPS Project