git push origin HEAD:<リモートブランチ名>报错

git がプッシュすると、エラーが報告されます。

fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use

    git push origin HEAD:<name-of-remote-branch>

解決策: すぐ後ろにプッシュしたいリモート ブランチの名前を書きます。

git push origin HEAD:master

おすすめ

転載: blog.csdn.net/weixin_44949068/article/details/129703457