前提・実現したいこと
GithubからPrivateリポジトリをcloneしたいです。
Githubには公開鍵認証を設定しています。
TESTというディレクトリがあり、TESTディレクトリ配下には以前cloneしたリポジトリがあります。
該当するリポジトリは当初公開しており、その時にcloneしました。
その後、リポジトリをPrivateに変更して非公開にしましたが、現在もpullとpushは出来ます。
今回新たにWORKというディレクトリを作成し、その配下にPrivateに変更したリポジトリをcloneしたいのですがエラーになります。
エラーの解消方法をご教授頂けないでしょうか。
無関係とは思いますが、GithubのWebサイトへのログインには二段階認証を設定しています。
該当のコマンド
sshによるGithubとの疎通確認は問題ありません
$ ssh -T git@github.com Enter passphrase for key '/home/hoge_user/.ssh/id_rsa': Hi hoge_user! You've successfully authenticated, but GitHub does not provide shell access.
httpsでのgit cloneがエラーになります
$ git clone https://github.com/hoge_user/tools.git Cloning into 'tools'... Username for 'https://github.com': hoge_user Password for 'https://hoge_user@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/hoge_user/tools.git/'
試したこと
既にclone済みのディレクトリではpullもpushも出来ます
$ cat ~/.gitconfig [user] email = hoge@hoge.com name = hoge_user
sshではclone出来ます
$ git clone git@github.com:hoge_user/tools.git Cloning into 'tools'... Enter passphrase for key '/home/hoge_user/.ssh/id_rsa': remote: Counting objects: 9, done. remote: Compressing objects: 100% (5/5), done. remote: Total 9 (delta 0), reused 9 (delta 0), pack-reused 0 Receiving objects: 100% (9/9), done.
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。