git 如何在 eclipse 和 egit 中转到以前的提交
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20199334/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to go to previous commits in eclipse and egit
提问by Mehdi Fanai
I have a git android project managed in eclipse and some times i want to temporarily roll back my android project to a specific time and then build it and do stuff and then restore to the latest version. How is this possible?
我有一个在 eclipse 中管理的 git android 项目,有时我想暂时将我的 android 项目回滚到特定时间,然后构建它并做一些事情,然后恢复到最新版本。这怎么可能?
回答by robinst
To check out an old state:
要查看旧状态:
- Open the Historyview for the repository (Window > Show view > Other... > Team > History)
- Select the commit at the time you want
- Context menu > Checkout
- 打开存储库的历史视图(窗口 > 显示视图 > 其他... > 团队 > 历史)
- 在您想要的时间选择提交
- 上下文菜单 >结帐
When you want to go back, just select the commit where master is (or the branch you were working on before) and select Checkoutagain. Because there is a branch there, it will automatically check out the branch instead of the commit.
当您想返回时,只需选择 master 所在的提交(或您之前处理的分支),然后再次选择Checkout。因为那里有一个分支,它会自动检出分支而不是提交。
Note that you may also have to enable "Show All Branches and Tags" in the history to see master in the history view, see the section in the user guide about this.
请注意,您可能还必须在历史记录中启用“显示所有分支和标签”才能在历史记录视图中查看 master,请参阅用户指南中关于此的部分。