最佳答案
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
中。