16
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows の SourceTree で GitHub から fetch/push ができなかった

Posted at

現象

Windows の SourceTree で Fetch しようとしたら、いつまでたっても終わらない。進行状況を表示すると、下記のようなメッセージのまま進まなかった。

The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)

GitHub のホストを信頼していいか聞いているが、 SourceTree から入力できない…

解決策

WindowsのSourceTreeでBitbucketからクローンできなかった を参考に

コマンドプロンプトで

"C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe" -ssh -C -i "path\to\private\key.ppk" git@github.com

と実行すると、上記メッセージが表示され、 y と返答。

Using username "git".
Server refused to allocate pty
Hi chatii! You've successfully authenticated, but GitHub does not provide shell
access.

となり、 GitHub にアクセスできた。これで SourceTree からも GitHub へアクセスできるように。

16
13
2

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
16
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?