Ergwun
Ergwun

Reputation: 12978

How do I filter log by folder in SourceTree?

In SourceTree, how do I limit the log to only show commits that affected files within a given folder?

I.e. the equivalent to: git log path/to/folder

Upvotes: 26

Views: 14098

Answers (4)

k-thorat
k-thorat

Reputation: 5123

My first thought was, Log Selected feature is only for files.

Then accidentally I hit Tree View - Voila!

I am using Mac, not sure this is available on Windows.

  • Change Source Tree settings to TreeView
  • As explained by @bozi Click on Log Selected

enter image description here

Upvotes: 3

user456814
user456814

Reputation:

This Answer is Outdated

This answer is now outdated. It was written before the 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 solution should now work for both the Windows and Mac versions of SourceTree.

Original Answer

Instead of using SourceTree, you can use

gitk -- folderPath

to view the history of just the folder. gitk takes many of the same options that git log does.

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.

Upvotes: 8

bozi
bozi

Reputation: 263

Click on the File Status segmented control in the top left corner.

Screenshot 1

Above the Files staged in the index area set the filters to Tree View and Show All. All of your files will appear in the Files in the working tree area.

Screenshot 2

Select one or more files and/or folders, right click and select Log Selected....

Screenshot 3

Upvotes: 21

Hidden
Hidden

Reputation: 3628

Actually there is no option for this at sourcetree. You can post this feature idea to the atlassian site.

Upvotes: 1

Related Questions