I know that the GitHub web interface lets you search all repositories for files with a particular pathname (e.g. searching for path:/app/models/user.rb
yields >
In search input, you can use filename
parameter to search in multiple repositories, for example:
filename:my_filename.txt
If you're looking for a filename in specific repository, you can just press t and start typing the file name (see: GH keyboard shortcuts).
I refined @andy-lester answer with intitle:
, i.e. I want to find where's located the file simple_spinner_item.xml
in Android's source code hosted on github, so I search on Google this string:
site:github.com intitle:simple_spinner_item.xml github.com/android
^ ^ ^
| | |
on github site | |
| |
filename I'm searching -+ |
|
github user ------------------------------------+
You can try Google. Google for filename.txt site:github.com
.
GitHub introduced FileFinder in 2011.
Try it out: just hit t on any repo's file or directory view.[1]
So, You're still restricted to repository.
[1]https://github.com/blog/793-introducing-the-file-finder
Another approach to Your question:
Can I use Git to search for matching filenames in a repository?
Just press "t" and It will let you search for a file.
I would like to clarify @ajain's answer.
More shortcuts for source code browsing.