Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

原因

.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
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away