How to search by filename?
Asked by Thiago Lima:

I'd like to search by filename in my branches. Today is possible the search by message commits, file change and actors, but is not possible by filename. Someone know tell if it is possible make this search? I'm using the SourceTree in version 1.9.6.2.


Answers:
author: Seth
body: You are correct, it's not possible to use the search tab to do what you want.

There is a two-step process that can get you there, but only works for one file at a time:

1) Find the file you want in the "File Status" tab using the search bar on that tab:

image2016-12-2 8:5:50.png

2) Right-click the file, and select "Log Selected...".

[](https://community.atlassian.com/t5/Sourcetree-questions/How-to-search-by-filename/qaq-p/203769?attachment-id=372){#link_11726038bc2e34}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/5912/1/image2016-12-2%208%3A5%3A25.png){#display_11726038bc2e34_0}  
[](https://community.atlassian.com/t5/Sourcetree-questions/How-to-search-by-filename/qaq-p/203769?attachment-id=373){#link_11726038bc2e34_0}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/5912/2/image2016-12-2%208%3A5%3A50.png){#display_11726038bc2e34_2}

comments: author: Thiago Lima
body: My difficulty is exactly this, find the file after commit, by tab "Search". Ideal would be have also a search input in tab "Search" for find files. I hope whitch implemented in future versions. Thank you @Seth.


author: thinsoldier
body: Not possible. What I do is go to the command line and save the entire git log to a text file. I can then open the text file in a text editor and use the find feature there. The great thing about this is the log will also contain the file names of files that were deleted.

```
git log --name-status --decorate &gt; _commit_dump.txt
```

Text file will contain stuff like this:

```
commit 30183ea616eeb2d6cc442f90e5d638fd2c07c372Author: thinsoldier &lt;thinsoldier@thinsoldier.com&gt;Date:   Sat Jul 2 21:47:15 2016 -0600    Refactor "wifi security" page code to have the main code run only after the device list has been fetched, and move some styling out of css and into stylesheet, and add a column to the device table that will be used later to show statusM    global.cssM    mac-address-list.phpM    wifi-security.jsA    migrate/017-add-device-status.sqlD    iframe-test.html
```

M = file was modified

A = file was added

D = file was deleted

comments: author: lucbloom
body: That's not a great thing, that's a GUI shortcoming. When I search for a file in the main window, I expect a list of commits involving that file. If I want a list of commits that only shows the changes to that file (to make searching in large commits easier), I can use the current search function I guess.

Feature request: make the search box available for "commits containing this filename". I never search for author or hash.


author: Thiago Lima
body: I want to know what the changes were in the searched file. Like this when is searched by actor the changes are showed. Sorry for my English.


author: Seth
body: Are you wanting to search for a list of commits where a certain file has been changed, or just find the file itself?