0
1

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 1 year has passed since last update.

Windowsの共用PCからGitHubにpushしたいけど認証が通らない時

Posted at

 色々と調べて知見が湧いたので。

想定する状況

 例えば共用PCで作業したとして、それを自分のリポジトリに反映させたい。しかし、ブラウザでは GitHub にアクセスできても、push しようとすると Permisson Denied と出る。

方法

ブラウザのプロフィールタブから Settings を選ぶ

image.png

Developer settings を選ぶ

image.png

Personal access tokens のタブから Tokens(classic) を選ぶ

image.png

Generate new token から Generate new token(classic) を選ぶ

image.png

Noteに適当な名前をつけ、repoにチェックを入れる

image.png

トークンが生成されるのでコピーする

image.png

 これは一度表示を消したら再表示できないのでメモする。もちろん他人に知られてはいけない。

Windows の資格マネージャーを開く

 スタートメニューに「資格情報」と打つとサジェストされるはず

image.png

「Windows 資格情報」の「汎用資格情報」からgit:https://github.comの「編集」を選ぶ

image.png

 もしなければ、「汎用資格情報の追加」を選ぶ。この場合、次の操作は「編集」ではなく「追加」となる。

ユーザー名とパスワードを入れる

 ユーザー名は自分の GitHub 上のユーザー名、パスワードはさっき生成されたトークンをコピペする。

完了

 これでリポジトリに編集を加えられるようになったはず。

 共用PCに認証情報が残っていると危ないので、編集が終わったら資格情報は「削除」しておいた方がいい。

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?