Skip to content

Instantly share code, notes, and snippets.

@LeeDDHH
Created August 11, 2025 05:30
Show Gist options
  • Save LeeDDHH/4839e75616d2bf3f345bddef97401866 to your computer and use it in GitHub Desktop.
Save LeeDDHH/4839e75616d2bf3f345bddef97401866 to your computer and use it in GitHub Desktop.
githubでユーザー名とパスワードを毎回聞かれる問題

githubでユーザー名とパスワードを毎回聞かれる問題

原因

git の設定が https 通信になっている可能性が高い

確認

  • https通信になっている場合
$ git remote -v
origin	https://github.com/△△××/◯◯△△.git (fetch)
origin	https://github.com/△△××/◯◯△△.git (push)
  • ssh接続になっている場合
$ git remote -v
origin	[email protected]:△△××/◯◯△△.git (fetch)
origin	[email protected]:△△××/◯◯△△.git (push)

解決策

  • remote.origin.url 先を確認して控えておく
    • git config --list
  • 通信をsshに変える
  • リモートレポジトリをセットしてあげる
    • git remote set-url origin [email protected]:△△××/◯◯△△.git
    • △△××/◯◯△△remote.origin.url 先で控えたものを使用する
  • git pull で確認してみる
    • git pull

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment