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 5 years have passed since last update.

rails-tutorialをcloud9環境でやっていて、githubにコミットできなかった場合の対処法

Last updated at Posted at 2019-09-23

rails-tutorialをGit-hubでやっていてpushができない場合の対処

rails-tutorialには

$ git remote add origin git@bitbucket.org:<username>/toy_app.git
$ git push -u origin --all

という記述がある
私は、git_hubでやっているので、このgit@bitbucket.org:<username>箇所をgithubのURLに書き換えて実行した

これを実行しようとした際にPermission denied (publickey).
と表示された。

書かれている通り、git-hubに公開鍵が登録されていないためにアクセスが拒否される

https://qiita.com/tanden/items/7919de68951a0c2ae9ac
この記事に書かれている対処法でほとんどOKながら
2019/09/23現在のcloud9環境は公開鍵がデフォルトで作られるみたいなので

cat ~/.ssh/id_rsa.pub
コマンドを実行

ssh-rsa ほにゃらら ip-なんとか

という形式で公開鍵が表示されるのでこの鍵を
https://github.com/settings/keys
のNew SSH Keyボタンを押してgithub側に登録

したらばめでたくGithubにコミットできるようになりました!

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?