Git Cloneができない😞
新しくPCを環境構築して、Gitの設定してもとのPCのファイルをCloneしようとしたらエラーが出た。。。
原因はsshの鍵を読み込ませていなかったこと
user.name, user.emailをターミナルに入れる
ssh-keygenで鍵作る
Gitに公開鍵を載せる
ssh-add で鍵を読み込ませる⭐️
4が重要!
詳しい状況👇---------------------------------
$git clone git@github.com:AAA/AAA.git
Cloning into 'AAA'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
これができなかった。。。
$ssh-add -l
The agent has no identities.
これだと鍵読み込めていない。
$ssh-add ~/.ssh/AAA
Enter passphrase for AAA:
Identity added: ~/.ssh/AAA
これでcloneできるようになった!
(参考文献)
この記事が気に入ったらサポートをしてみませんか?