我做到了
git checkout origin/master
# made some changes
git commit -a -m "test something"
此后,我做了git checkout master
。然后我收到了这个消息
Warning: you are leaving 1 commit behind, not connected to
any of your branches:
44af060 test something
If you want to keep it by creating a new branch, this may be a good time
to do so with:
git branch <new-branch-name> 44af060
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
我的问题是,为什么此提交不属于任何分支。我是在原产地/原产地头上制成的。
答案 0 :(得分:0)
我只是想提供帮助。
初始化存储库时,您位于master / origin分支中,因此,如果您创建了另一个分支,则可能需要从该分支中提交
您还可以使用reflog引用您去过的任何地方:
git reflog
然后您可以提交