Egit再次出击。我犯了一个错误,试图切换到 EGit 中的另一个分支,结果不知何故搞砸了,没有检查到任何分支。然后我对这个非分支进行了提交,然后当我意识到我没有跟踪正确的分支时,我运行了以下命令:
$ git checkout issue2
Warning: you are leaving 1 commit behind, not connected to any of your branches:
bada553d My commit message
If you want to keep them by creating a new branch, this may be a good time to do so with:
git branch new_branch_name ....
Branch issue2 set up to track remote branch issue2 from origin.
Switched to a new branch issue2.
现在我已经搞砸了,我如何将该提交与我当前的分支关联起来?我对创建一个全新的分支不感兴趣,我只想将该提交拉到我的分支中,issue2
.
you can git cherry-pick bada553d
如果这只是一次提交。
您还可以使用引用日志来引用您去过的任何地方:
git reflog
然后使用这些提交之一:
git checkout -b temp HEAD@{3}
从当前提交 3“次”前的位置签出并创建分支临时值。这是你曾经所在的地方的面包屑。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)