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 1 year has passed since last update.

Dev Containerでリモートリポジトリにプッシュできない時の対処法とは?

Posted at

プロジェクトをVSCodeのDev Container拡張機能を使って開いている状態で、リモートリポジトリにプッシュしようとしたらエラーダイアログがでることがあります。

以下はダイアログに表示されている内容の一文です。

You don't have permissions to push to "takagimeow/remix-auth-jwt-cloudflare-workers" on GitHub. Would you like to create a fork and push to it instead?

結論から言ってしまうと、ローカル環境側で使用されているGitHub用の秘密鍵がssh-addを使って正しく登録されていない場合にこの問題が発生していました。

一度ローカル環境側と、Dev Container側でssh-add -lを実行して、秘密鍵が登録されているかを確認します。

ssh-add -l

登録されていない場合は、ローカル環境側でssh-addを使って秘密鍵を登録します。

ssh-add -K ~/.ssh/github_rsa

Dev Container側でリモートリポジトリにプッシュしてみて、エラーメッセージが出なくなれば完了です。

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?