LoginSignup
0
0

More than 1 year has passed since last update.

今までGitHubとアイパスで接続してた人向け

Last updated at Posted at 2021-08-16

散々警告されていた通り、2021年8月13日からGitHubにアイパスで繋がらなくなってしまった

# git fetch
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.

散々言ってただろと。

きちんと認証局を使っていた人は問題ないが、当方みたいに横着して接続用のURLにアイパスを直接書いていた人は以下が正攻法なようです。

VSCodeの設定:(Windows)

GitHub上からアクセストークンを取得して、(※後述)
コントロールパネル → 資格情報マネージャー → Windows資格情報 → https://github.com を選んで編集
ユーザ名 → 今まで通り
パスワード → 発行したアクセストークン

たぶんVSCodeだけじゃなくて一般的なIDEなら全部これでいけるはず

Linux系を使っている場合の設定:(当方はCentOS)

# git credential-store --file ~/git.store store
protocol=https
host=github.com
username → 今まで通り
password → 発行したアクセストークン

これでOK

.git/config に url=ユーザ名:パスワード@github.com と書いていたアホ(私です) は、ユーザ名パスワードをきちんと消しておきましょう。

タイムアウト無制限 (100年)

# git config --global credential.helper "cache --timeout=3153600000"

■アクセストークンの取得方法

あろうことか公式ドキュメントが一番わかりやすい
(https://docs.github.com/ja/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)
要約すると

プロフィールアイコン → Setting → Developer settings → Personal access tokens → Generate new token →
適当な名前で、スコープはとりあえず全部付けておく
expireはめんどいので無期限を選択

画面にトークンコードが表示されるのでメモ
※ 今後二度と表示出来なくなるので確実にメモしておいてください

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0