git 如何在 Eclipse 的 EGit 中查看单个分支的历史记录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24628522/
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 can I view the history of a single branch in EGit for eclipse
提问by Stijnvdk
When reviewing code in eclipse using EGit plugin, before merging it to the develop branch, you switch to the branch and see what files changed with the commits on that branch. For this I would like to see -only- the commits to the current checked out branch. When using Team -> Show in History, I get the complete history across all branches.
在 Eclipse 中使用 EGit 插件查看代码时,在将其合并到开发分支之前,您切换到该分支并查看该分支上的提交更改了哪些文件。为此,我希望仅查看对当前签出分支的提交。使用 Team -> Show in History 时,我会获得所有分支的完整历史记录。
How can I view only the commits to the current checked out branch, instead of having to search trough the complete GIT history to find the relevant commits?
如何仅查看对当前签出分支的提交,而不必搜索完整的 GIT 历史记录以查找相关提交?
Using review tools like Gerrit are not an option.
使用 Gerrit 之类的工具不是一种选择。
回答by VonC
You can check the filter button in the History View:
您可以检查历史视图中的过滤器按钮:
All Branches
所有分行
This toggle activates the "
All Branches
" mode.
By default, only those commits are shown in the commit log that can be reached from the currently checked out commit, i.e. the Commit Graph ends with the currently checked out commit and newer commits are not shown.
If this button is down, all commits will be shown in the commit log.
This is illustrated in the following picture from our example. The branch "beforeSplit" is currently checked out; by activating the toggle, the newer branches will become visible:
此切换激活“
All Branches
”模式。
默认情况下,只有那些可以从当前签出的提交到达的提交日志中显示提交,即提交图以当前签出的提交结束,并且不显示较新的提交。
如果此按钮关闭,则所有提交都将显示在提交日志中。
这在我们示例中的下图中进行了说明。分支“beforeSplit”当前被检出;通过激活切换,较新的分支将变得可见:
And you need to combine that with:
您需要将其与:
"Additional Refs" toggles the visibility of certain Refs created during actions like fetch, rebase, merge, for example FETCH_HEAD, ORIGIN_HEAD... This can be helpful to remove clutter from the history view.
“附加参考”切换在获取、变基、合并等操作期间创建的某些参考的可见性,例如 FETCH_HEAD、ORIGIN_HEAD...这有助于从历史视图中消除混乱。
回答by Sharif
You might need to un-check the "Additional Ref" option. please see the attached image.
您可能需要取消选中“附加参考”选项。请参阅附图。