2015-09-19 23 views
5

私はGit for Windowsを使用しています。私はSSH鍵を作成し、this articleに従って自分のGitHub設定の鍵リストに追加しました。今私はそれを使用しようとするが、私はエラーが表示されます:remote:ユーザー名またはパスワードが無効です。致命的:認証に失敗しました

$ git push origin master 
Username for 'https://github.com': Andrey-Bushman 
Password for 'https://[email protected]': 
remote: Invalid username or password. 
fatal: Authentication failed for 'https://github.com/Andrey-Bushman/sandbox.git/ 

どうすれば修正できますか?

+0

ユーザー名 'git'を使用する必要があります。 – Kenney

+0

'git remote -v'の結果を書くことができますか? –

答えて

3

まず必ず、SSHキーが正常にコマンドを実行することで作成されます

$ ssh -T [email protected] 

ない場合はそれがSSH Access to Gitを参照し、その後、 "Hi Andrey-Bushman! You've successfully authenticated, but GitHub does notprovide shell access."

を印刷する必要があります。

  1. クローンレポとしてSSHプロトコルを使用して::

    あなたのケースでは

    [email protected]:<github-username>/<repo>.git

    [email protected]:Andrey-Bushman/<repo>.git

  2. コミットしたら、以下の手順に従って行わ

    あなたのチャンネルレポへの怒り。

  3. 次に、あなたの場合はgit push origin <branch-name>

    git push origin master

+0

>「Hi Andrey-Bushman!」と表示された場合、認証は成功しましたが、GitHubはシェルアクセスを提供しません。はい、印刷されます。 –

+0

> [email protected]:Andrey-Bushman/ .gitどこで使用する必要がありますか? –

+2

いいえ、まず、sshを使ってrepoをクローンしてから、origin名を使ってプッシュする必要があります。 – Arpit

関連する問題