git 如何按 SourceTree 中的文件夹过滤日志?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17607289/
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 do I filter log by folder in SourceTree?
提问by Ergwun
In SourceTree, how do I limit the log to only show commits that affected files within a given folder?
在 SourceTree 中,如何将日志限制为仅显示给定文件夹中受影响文件的提交?
I.e. the equivalent to:
git log path/to/folder
即相当于:
git log path/to/folder
采纳答案by bozi
This Answer is Outdated
此答案已过时
This answer is now outdated.It was written beforethe Windows version of SourceTree had this feature built-in. The current version of SourceTree for Windows (1.5.2.0) has this feature now, so @bozi's solutionshould now work for both the Windows and Mac versions of SourceTree.
这个答案现在已经过时了。它是在Windows 版本的 SourceTree 内置此功能之前编写的。当前版本的 SourceTree for Windows (1.5.2.0) 现在具有此功能,因此@bozi 的解决方案现在应该适用于 SourceTree 的 Windows 和 Mac 版本。
Original Answer
原答案
Instead of using SourceTree, you can use
您可以使用,而不是使用 SourceTree
gitk -- folderPath
to view the history of just the folder. gitk
takes many of the same options that git log
does.
仅查看文件夹的历史记录。 gitk
采取许多相同的选项git log
。
Another option is to use another Git gui like TortoiseGit, which will let you select folders in Windows Explorer and right-click to get a context menu, from which you can select to view the log for that one particular folder.
另一种选择是使用另一个 Git gui,如 TortoiseGit,它可以让您在 Windows 资源管理器中选择文件夹并右键单击以获取上下文菜单,您可以从中选择查看该特定文件夹的日志。
回答by bozi
Click on the File Statussegmented control in the top left corner.
单击左上角的文件状态分段控件。
Above the Files staged in the indexarea set the filters to Tree Viewand Show All. All of your files will appear in the Files in the working treearea.
在索引区域中暂存的文件上方,将过滤器设置为Tree View和Show All。您的所有文件都将出现在工作树区域的文件中。
Select one or more files and/or folders, right click and select Log Selected....
选择一个或多个文件和/或文件夹,右键单击并选择Log Selected...。
回答by kthorat
My first thought was, Log Selected feature is only for files.
我的第一个想法是,Log Selected 功能仅适用于文件。
Then accidentally I hit Tree View - Voila!
然后我不小心点击了树视图 - 瞧!
I am using Mac, not sure this is available on Windows.
我使用的是 Mac,不确定这是否适用于 Windows。
- Change Source Tree settings to TreeView
- As explained by @bozi Click on Log Selected
- 将源树设置更改为 TreeView
- 正如@bozi 所解释的,单击所选日志
回答by Hidden
Actually there is no option for this at sourcetree. You can post this feature idea to the atlassian site.
实际上在 sourcetree 上没有这个选项。您可以将此功能创意发布到 Atlassian 站点。