LoginSignup
0
0

More than 1 year has passed since last update.

macの再起動後、SourceTreeのgit操作でエラーが発生する

Last updated at Posted at 2021-12-03

## 困ったこと
macを再起動した際、再起動前に成功していたSourceTreeのgit操作が失敗するようになります。
その際に以下のエラーメッセージが出力されます。

Please make sure you have the correct access rights
and the repository exists.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

OS:macOS Big Sur
SourceTree: 4.1.3
SSH鍵はgithubに登録済み
SourceTreeとgithubのアカウント連携も済
リモートリポジトリも登録済
ターミナル上でgitコマンドを使った接続は成功する

原因

SSH鍵にパスフレーズが設定されている場合に発生するようです。
詳しくは以下記事にて解説されております。原因特定の際に大変助かりました。
https://qiita.com/yuki153/items/0ad5cb02faf3ecdcf903

対処法

上記記事の中でも解説頂いておりますが、.ssh配下のconfigファイルに以下の1行を追加する事で解消しました。

UseKeychain yes

これによって、再起動後でもSourceTreeにて問題なく実行できるようになるはずです。

誤り等あればご指摘頂けますと幸いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0