個人アクセストークン(PAT)

GitHub の概念の紹介

George Boorman

Curriculum Manager, DataCamp

認証

  • ターミナルでGitを使用してGitHubとやり取りできる
git clone https://github.com/george-boorman/bank_marketing
Username for 'https://github.com': george-boorman
Password for 'https://[email protected]':
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/george-boorman/bank_marketing/'
GitHub の概念の紹介

GitHub ドキュメント

GitHub ドキュメントページで、リモートリポジトリに対して git clone、git fetch、git pull、または git push を実行するときに個人用アクセストークンを提供する手順が表示されている。

1 https://docs.github.com/ja/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls
GitHub の概念の紹介

個人アクセストークンとは何ですか?

  • 個人アクセストークン(PAT)

    • ターミナルでの認証にパスワードの代わりに使う代替手段
    • 2021 年 8 月以降、パスワードの代わりに必須
    • より安全な
  • GitHub では不要

    • ターミナルを使用してリモートリポジトリにアクセスする場合のみ
1 https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
GitHub の概念の紹介

個人用アクセストークンを作成する

プロフィールページから設定セクションにアクセスする

GitHub の概念の紹介

個人用アクセストークンを作成する

設定ページの開発者設定

GitHub の概念の紹介

個人用アクセストークンを作成する

開発者設定ページに 3 つのオプションが表示されている: GitHub アプリ、OAuth アプリ、個人用アクセストークン

GitHub の概念の紹介

個人用アクセストークンを作成する

個人用アクセストークンセクションで、新しいトークンを生成ボタンが表示されている

GitHub の概念の紹介

個人用アクセストークンを作成する

新しい個人用アクセストークンのメモと有効期限セクション

GitHub の概念の紹介

個人用アクセストークンを作成する

リポジトリアクセスのチェックボックスを選択する

GitHub の概念の紹介

個人用アクセストークンを作成する

トークンを生成するボタン

GitHub の概念の紹介

PAT を使用する

コピーできる英数字の組み合わせとして表示された個人用アクセストークン

GitHub の概念の紹介

PAT を使用する

コピーできる英数字の組み合わせとして強調表示された PAT

  • PAT を共有しない!
GitHub の概念の紹介

PAT を使用する

git clone https://github.com/george-boorman/bank_marketing
Cloning into 'bank_marketing'...
Username for 'https://github.com': george-boorman
Password for 'https://[email protected]':
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
ls
bank_marketing
GitHub の概念の紹介

練習しましょう!

GitHub の概念の紹介

Preparing Video For Download...