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.

GitHubでリモートリポジトリにpushしようとしたらerror: failed to push some refs to ...(URL)と出てきたとき

0
Last updated at Posted at 2020-11-16

ネットに書いてある情報をそのままコピペしてGitHubのリモートリポジトリに初pushしようとしたら error: failed to push some refs to ...とエラーが出てきました。

$ git add .
$ git commit -m "First commit"
$ git push origin master
 error: src refspec master does not match any
 error: failed to push some refs to '

GitHubページをよく見てみたら、デフォルトのbranchがmasterじゃなくてmainに変わっていました。

ということで

$ git push origin main

でいけました。

チャンチャン

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?