LoginSignup
0
0

More than 1 year has passed since last update.

git pushのやり方 Please make sure you have the correct access rights and the repository exists.

Posted at
git remote add origin https://github.com/Harasou21/repo_name

をやって、

$ git push origin master

を実行したら

fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

と表示が出てきた人も多いと思う。

これは、誰でも彼でもpushできるようになったらいけないので、
pushできる権限を付与してあげる必要がある。
言い換えれば、自分がgithubのアカウントの持ち主だよ。と認証してあげる必要がある。

push のやり方

スクリーンショット 2021-12-01 21.11.18.png

ユーザー画面のセッティングをクリック

スクリーンショット 2021-12-01 21.11.46.png

セッティング画面の「Developer Settings」をクリック

スクリーンショット 2021-12-01 21.13.17.png

Personal access tokensをクリックして
Generate new tokenをクリック

したらいろいろでてくるが、トークンの名前は適当でもよくて、
expire(トークンの有効期限)も、任意の有効期限でいいと思います。
もちろん短ければ短いほど、セキュリティは高まりますが、有効期限切れるたびに再登録はめんどくさい。
いろいろなチェックリストもありますが、全部にチェックしといて大丈夫

スクリーンショット 2021-12-01 21.15.25.png

したらこのようにトークンがでてるくので
メモ帳とかにはりつけておいてください。
あとで使うので

ターミナルに戻って

soichirohara@SoichironoMacBook-Pro ideaFrameworks % git push origin master
Username for 'https://github.com': 
Password for 'https://Harasou21@github.com': 

Usernameの部分は、自分のユーザーネーム

passowordの部分は、自分がさっき取得したトークンを入力します。

そうしたら、pushされるはずです。

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