[Mac] Git submodule 抓不下來?原來是 SSH key 過期了…
今天想抓 git submodule 時,突然出現 Permission denied 錯誤:
$ git submodule update Cloning into '/artifactory'... [email protected]: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. fatal: clone of '[email protected]:platform/release.git' into submodule path '/artifactory' failed Failed to clone 'artifactory'. Retry scheduled
用 ssh 指令測試一下,一樣的 Permission denied 錯誤:
$ ssh -T [email protected] [email protected]: Permission denied (publickey).
到 https://github.xxx.com/settings/keys 看一下,
這才發現 SSH key 已經因為過期,被自動移除了~
(好像沒有收到什麼通知…)
趕緊重新產生一組新的 SSH key:
ssh-keygen -t ed25519 -C [email protected]
再把產生出的 id_ed25519.pub 檔案的內容,
加到 GitHub SSH keys 裡面:
再測試一次,SSH 已經能通了:
$ ssh -T [email protected] Hi ephrain! You've successfully authenticated, but GitHub does not provide shell access.
自然 git submodule 也能抓下來囉:
$ git submodule update Cloning into '/artifactory'... Submodule path 'artifactory': checked out 'e9......'
(本頁面已被瀏覽過 5 次)