Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
40
Help us understand the problem. What is going on with this article?

More than 1 year has passed since last update.

@kenkono

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

40
Help us understand the problem. What is going on with this article?
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
40
Help us understand the problem. What is going on with this article?