# git

### find all commits touching a file

today I had some changes to a file sitting on an old branch from a couple months ago, and I wasn’t sure *which* branch. [stackoverflow user BigMiner shared this](https://stackoverflow.com/a/34666649), which worked great:

> I have been looking at this closely and all these answers don‘t seem to really show me all the commits across all the branches.
> 
> Here is what I have come up with by messing around with the [gitk](https://git-scm.com/docs/gitk) edit view options. This shows me **all the commits for a file** regardless of branch, local, reflog, and remote.
> 
> ```
> ```php
> gitk --all --first-parent --remotes --reflog --author-date-order -- filename
> 
> ```<small class="shcb-language" id="bkmrk-code-language%3A-php-%28">Code language: PHP (php)</small>
> ```
> 
> It also works with `git log`:
> 
> ```php
> git log --all --first-parent --remotes --reflog --author-date-order -- filename
> ```