2023年4月21日金曜日

ssh鍵を別マシンで使ったらgit cloneでrepository not found になった

 

いつもはLinuxマシン(debian)で開発している。

Linuxマシン(debian)で使用していたSSH鍵を使いまわそうとして、WindowsマシンのWSL2(ubuntu)にコピーしてgit clone したら、下記のエラーになった。

$ git clone git@github.com:user/demo.git
Cloning into 'demo'...
Warning: Permanently added 'github.com,20.27.177.113' (ECDSA) to the list of known hosts.
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


Linuxマシン(debian)のSSH鍵を使いまわすことは、できないみたい。

WindowsのWSL2(ubuntu)でSSH鍵を作ってGithubに登録したら、git cloneできました。