コードをレポにプッシュしようとすると、fatal:Authenication Failure が発生します。github アカウントにも公開鍵を追加しました。私がするとき:
ssh -i git@github.com
私は得る
Hi amangupta052! You've successfully authenticated, but GitHub does not provide shell access.
誰でも助けることができますか?ありがとう
これは、使用したリモート URL によって異なります。
git remote -v
返す場合:
https://github.com/username/reponame
そうすれば、ssh の設定は問題になりません。しかし、これはうまくいくでしょう:
ssh://git@github.com:username/reponame
もう 1 つの原因は秘密鍵に関連しています。パスフレーズで保護されていて、特殊文字が含まれていると、通常はうまく機能しません。
その他の ssh の失敗の原因については、こちらを参照してください。
リモート named を置き換えるには、次のコマンドorigin
を使用します。git remote
git remote set-url origin ssh://git@github.com:username/reponame
( rmeote url の変更に関するGitHub ヘルプ ページで説明されているように)
あなたが見る場合::
ssh: Could not resolve hostname github.com:amangupta052:
Name or service not known
fatal: The remote end hung up unexpectedly
非 scp ssh 構文を試してください。
git remote set-url origin ssh://git@github.com/username/reponame
(の後/
の ' ' の代わりに' ' に注意してください):
github.com
このブログ投稿でコメントされているように、おそらくこれはうまくいったでしょう:
git remote set-url origin git@github.com:username/reponame
(scp に似た構文ですが、ssh://
プレフィックスはありません)
ここで言及したように、scp 構文は通常、~/.ssh/config
ファイルが適切に機能することを意味します。