8
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Githubにpush時に毎回ユーザ名とパスワード聞かれないようにする

Posted at

Githubにpushすると、毎回のようにユーザ名とパスワード聞かれるようになっています。

> D:\sample_project> git push origin master
> Username for 'https://github.com':

現在のURLを確認すると以下のようになっています。

> D:\sample_project> git remote -v
> origin  https://github.com/ユーザ名/リポジトリ名.git (fetch)
> origin  https://github.com/ユーザ名/リポジトリ名.git (push)

URLに__ユーザ名とアクセストークン__を追加すれば、問題解決できました。

> D:\sample_project> git remote set-url origin https://ユーザ名:アクセストークン@github.com/ユーザ名/リポジトリ名.git/
> D:\sample_project> git remote -v
> origin  https://ユーザ名:アクセストークン@github.com/ユーザ名/リポジトリ名.git/ (fetch)
> origin  https://ユーザ名:アクセストークン@github.com/ユーザ名/リポジトリ名.git/ (push)

ちなみにGithubのアクセストークンは、__Githubサイト右上の自分のアイコン -> Settings -> Developer Settings -> Personal access tokens__で生成できます。

8
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
8
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?