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.

【GitHub】GitHubにpushする際のエラー解決メモ(error: src refspec main does not match any)(error: failed to push some refs to)

Posted at

日本語に苦戦しているSYOです。

Qiita CLIを使用して、qiita initを実行したディレクトリ全体をGitHubpushしようとした際に、以下の問題に遭遇しました。

これは問題を解決するためのメモです。

事象

コマンド
git remote add origin https://XXXXXX.git
git branch -M main
git push -u origin main
エラー
error: src refspec main does not match any
error: failed to push some refs to 'https://XXXXXX.git'

解決

原因
  • 変更をコミットしていない
コマンド
git add .
git commit -m "First Commit"
git push -u origin main

参考

Qiita CLI
Github 初push時のエラー ~ src refspec main does not main any

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?