27
30

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.

Githubでpushしようとするとerrorが出る場合

Posted at

マシンを変更してGithubにpushしようとするとエラーが出た.

まずはsshの設定をする必要があり,Githubに登録されている公開鍵に対応する秘密鍵をそのマシンにも入れておく必要がある.

それでも下記のようなエラーが出る場合,

$ git push origin master
fatal: remote error:
You can't push to git://github.com/ryokbys/nap.git
Use https://github.com/ryokbys/nap.git

下記のようになっていると思われるから,

$ git remote -v
origin git://github.com/ryokbys/nap.git (fetch)
origin git://github.com/ryokbys/nap.git (push)

設定変更する.

$ git remote set-url origin git@github.com:ryokbys/nap.git

すると,次ようになるはずで,pushできるようになるらしい.

$ git remote -v
origin git@github.com:ryokbys/nap.git (fetch)
origin git@github.com:ryokbys/nap.git (push)
27
30
1

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
27
30

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?