![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github-1024x591.jpg)
概要
2021年8月13日から、GitHubではパスワードによる認証が廃止されました。
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/jos-sugi/mare.git/'
秘密鍵を用いた認証などいくつか方法がある中で、パーソナルトークンで認証する方法をよく使用しています。
毎回思い出して認証を通しているためメモとして残します。
パーソナルトークンの作成
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_settiong-1-edited.png)
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_developer_settiong-edited.png)
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_classic-edited.png)
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_classic_new-1-edited.png)
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_note-edited.png)
- Note:トークン名(何でもOK)
- expireation:有効期限
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_repo-edited.png)
repo
repo:status
アクセス コミット ステータス
repo_deployment
デプロイメントステータスへのアクセス
public_repo
パブリック リポジトリにアクセスする
repo:invite Access
リポジトリへの招待
security_events
セキュリティ イベントの読み取りと書き込み
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_generate-edited.png)
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_generate_copy-edited.png)
アクセストークンの設定
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_gitconfig-edited.png)
- .configはホームディレクトリにあります。
command⌘ + shift⇧ + H
でホームディレクトリに移動します - .configは隠しファイルです。
command⌘ + shift⇧ + .
で隠しファイルを表示します
![](https://engineer-jose-blog.com/wp-content/uploads/2023/01/github_access_token_gitconfig_edit-2-edited-1.png)
[url "https://[作成したアクセストークン]:x-oauth-basic@github.com/"]
insteadOf = https://github.com/
もしくはターミナルで
git config --global url."https://[作成したアクセストークン]:x-oauth-basic@github.com/".insteadOf "https://github.com/"