0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitHubのHTTPS接続不可の事例

Posted at

GitHubでPATを作成する

  1. GitHubにログイン
  2. 画面右上のプロフィール画像をクリック → Settings(設定)を開く
  3. 左メニューから Developer settings を選択
  4. Personal access tokens → Tokens (classic) をクリック
  5. Generate new token ボタン → Generate new token (classic) をクリック
  6. トークンに名前をつける(例: “My MacBook PAT”)
  7. Expiration(有効期限)を設定(例: 30 days, 60 days, no expirationなど)
  8. **Scopes(権限)**を選択
    • Git操作なら最低限 repo にチェック(リポジトリの読み書き権限)
    • 他に必要な権限があれば追加
  9. Generate token ボタンをクリック
  10. 表示されたトークン(英数字の文字列)をコピーする(この画面でしか見られません)

スクリーンショット 2025-08-01 19.47.07.png
スクリーンショット 2025-08-01 19.48.14.png

ローカルGitでの認証にPATを使う

Gitでリモート操作(pushやpull)をするときにパスワードを聞かれたら、
• ユーザー名 はGitHubのユーザー名またはメールアドレス
• パスワード の代わりに、先ほどコピーした PATトークンを入力 します

結果:接続できませんでした。

kerumatomomitsu@kerumatomomitsunoMacBook-Air product-management-app % git push -u origin main
Username for 'https://github.com': T.K
Password for 'https://T.K@github.com': 
remote: Permission to TK-19881224/product-management-app.git denied to TK-19881224.
fatal: unable to access 'https://github.com/TK-19881224/product-management-app.git/': The requested URL returned error: 403
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?