0
0

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.

git push で403が出たらユーザー名を指定してset-urlすればいいみたい

Last updated at Posted at 2021-06-11

新しいgithubアカウントを作って
新しいリポジトリをリモートで作って
ローカルで開発していたソースを

git remote add origin <URL>

add して、commitして、 pushするとエラー

remote: Permission to hogehoge/fugafuga.git denied to hogehoge.
fatal: unable to access 'https://github.com/foofoo/fugafuga.git/': The requested URL returned error: 403

これまで使ってたローカルのgithubアカウントと、
新しく作ったアカウントが違うので、
権限がないんですね

下記コマンドを実行すると新しいアカウントのパスワードを聞かれて権限なくてもコミットできるようです

git remote set-url origin https://hogehoge@github.com/hogehoge/sample_app.git

hogehogeにはリモートのユーザーネームいれましょう!

まだ詳細は理解できてませんが自分用の備忘録です!

参考
https://www.codeadvisor.jp/entry/2018/04/07/234129

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?