Hunting for Rabbits in GitHub
GitHub is an amazing resource as well all know, but have you ever come across a large project which was hosted there and found you needed to hunt for something? Perhaps you support that project and want to know where a string is used in a webpage, or you think you need to see a particular file, but don’t know where to hunt in the many source directories. Rabbit…watch out because there are some really good searching features as part of the website and that’s what I am going to describe next.
Searching for Text
For my example, I am going to use this repository: https://github.com/findsorguk/findsorguk. Let’s say you went to the website which this code builds (http://www.finds.org.uk), and you saw that they used the phrase: “Large image view and metadata” but you wasn’t quite sure where that was in the codebase. Firstly, go to the repositories main page and find this at the top:
Now type in the text “Large image view and metadata”, press enter and you will get back something like this:
You can see that it has searched within each file for that string. What’s more, it has also shown which issues contained that text (see “Issues” on the left) which will be shown when you click on the word, Issues.
Searching for Files
That’s already really useful but there is also a way to hunt for files. Can you see this button?
If you click on that, you are presented with another form where you can type a string which would appear in a filename.
In the next example, you can see I am searching for the word: “image“ and as I do so, it starts to filter the results.
If you want to view any of the files (why wouldn’t you, of course - you are searching for them!). Just click on one of the rows. Ta-da! So, here you have two ways which allow you to hunt for things in a GitHub repository, even if they’re not necessarily rabbits.
Hi! Did you find this useful or interesting? I have an email list coming soon, but in the meantime, if you ready anything you fancy chatting about, I would love to hear from you. You can contact me here or at stephen ‘at’ logicalmoon.com