事象
新しく作成したレポジトリに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