Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
35
Help us understand the problem. What is going on with this article?
@tanishilove

GitHub リポジトリに git push したら Permission が denied

More than 3 years have passed since last update.

よく知られていることかもしれませんが,自分への備忘録として書いておきます.

GitHub (アカウント hoge) でリポジトリ ("abc") 作成: hoge/abc

GitHub で以下のように提示されるとおり

echo "# abc" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/hobe/abc.git
git push -u origin master

git push すると

$ git push origin master
remote: Permission to hoge/abc.git denied to fuga.
fatal: unable to access 'https://github.com/hoge/abc.git/': The requested URL returned error: 403

ローカル側に何らかの理由で fuga という別アカウントが紐付いている?

取り急ぎ解決策として

$ git remote set-url origin https://hoge@github.com/hoge/abc.git
$ git push origin master
Password for 'https://hoge@github.com': 

パスワード入れると無事に push されました(^^)

35
Help us understand the problem. What is going on with this article?
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

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
35
Help us understand the problem. What is going on with this article?