LoginSignup
10
5

More than 5 years have passed since last update.

GitHubリポジトリで毎回UsernameとPasswordを求められる時の対処法

Last updated at Posted at 2016-09-15

原因

.git/configのリポジトリURLがhttps経由になっているのが原因です。

対処法

[remote "origin"]
    url = https://github.com/project/hogehoge.git 
  • https:// を git@ に変更
  • github.com/projectの間の / を : に変更
[remote "origin"]
    url = git@github.com:project/hogehoge.git 
  • うまくいかないときは、以下のコマンドを実行すると現在のログインしているユーザーを確認できます。[username]が意図している名前になっているか確認してみて下さい。
ssh -T git@github.com
> Hi [username]! You've successfully authenticated, but GitHub does not provide shell access.

UserNameの変更方法

特定リポジトリ内のみでuserとemailを変える方法
--globalオプションではなく、 --localオプションで可能です

$ git config --local user.name 名前
$ git config --local user.email "メールアドレス"

書き換わったら以下で適用されているか確認します。

git config --local --list
10
5
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
10
5