50
Help us understand the problem. What are the problem?

More than 1 year has 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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
50
Help us understand the problem. What are the problem?