LoginSignup
6

More than 5 years have passed since last update.

bitbucketにpushできない

Posted at

事象

新しく作成したレポジトリにpushすると何故かエラーになる

git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

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

パーミッションが通らない、権限がないと言われてしまう。

解決策

色々と格闘した末、下記を打ち込むことで解決した。
(理由はよくわからない…)

※2つのaccountnameには自分のアカウント名、reponameにはレポジトリ名が入る。

$ git remote add origin https://accountname@bitbucket.org/accountname/reponame.git
$ git remote set-url origin https://accountname@bitbucket.org/accountname/reponame.git

参考記事(あとで読み込みたい)
https://stackoverflow.com/questions/16074832/cannot-push-to-git-repository-on-bitbucket/28034014

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
6