#UE4 #UE4Study https://github.com/EpicGames/UnrealEngine.git をクローンしようとしたら出たエラー 「remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.」を解決

SourceTreeでクローンしようとしたらこんなエラーが出たのでメモ

コマンド: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote https://github.com/EpicGames/UnrealEngine.git
出力: 
エラー: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for 'https://github.com/EpicGames/UnrealEngine.git/'

翻訳すると

コマンド:git -c diff.mnemonicprefix = false -c core.quotepath = false --no-optional-locks ls-remote https://github.com/EpicGames/UnrealEngine.git
段:
エラー:リモート:パスワード認証のサポートは2021年8月13日に削除されました。代わりに、個人用アクセストークンを使用してください。
リモート:詳細については、https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/を参照してください。
致命的:「https://github.com/EpicGames/UnrealEngine.git/」の認証に失敗しました

調べてみると

GitHubのリポジトリにアクセス時に「remote: Support for password authentication was removed on August 13, 2021.」エラー さんがこんな感じで書いてた

https://note.kiriukun.com/entry/20210904-github-password-authentication-was-removed

GitHubにログインして、右上の自分のアイコンをクリック → 「Settings」をクリック

→ 左メニュー下部の「Developer settings」をクリック

→ 左メニューの「Personal access tokens」をクリック

→ 右上の「Generate new token」をクリックしてアクセストークンを作成する。

アクセストークンを作成する時、「Select scopes」は少なくとも「repo」をチェックONにすること。

また、作成したトークンの値を後でもう一度確認することはできないので、作成後はその場ですぐにコピーしてどこかにとっておくこと。

こうして作成したアクセストークンをパスワードの代わりに入力することで、GitHubのリポジトリにアクセスできるようになる。

URLに付与する方法

パスワードの代わりに入力する他では、以下のようにGitリポジトリのURLに付与して使うこともできる。

git clone https://${アクセストークン}@${ユーザー名}/${リポジトリ名}.git

具体例

https://ghp_ooooooooooooooooooooooo@github.com/EpicGames/UnrealEngine.git

クローンできた!!!

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です