LoginSignup
52

More than 3 years have passed since last update.

posted at

gitをpushする際にエラー発生(error: src refspec ブランチ名 does not match any)

エラー詳細

任意のブランチをpushする際に、下記のようなエラーが発生しました。

$ git push origin ブランチ名
error: src refspec ブランチ名 does not match any

git branchを実行すると、下記のような表示がでます。

$ git status
develop
master
*(HEAD detached at origin/49792)

解決策

git push origin HEAD:pushしたいブランチ名

参考

making a git push from a detached head

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
What you can do with signing up
52