left-icon

GitHub Succinctly®
by Joseph D. Booth

Previous
Chapter

of
A
A
A

CHAPTER 5

Advanced Searching

Advanced Searching


GitHub’s search engine hides the advanced options from a search, but provides a lot of additional functionality using different constructs within your search string. You can explore the advanced options by clicking on the Advanced search link underneath the list of languages.

Advanced options

The Advanced options section allows you to look for repositories owned by particular users and companies, or even restrict the search to a particular repository. You can also search by date range or filter results to a particular programming language.

Advanced options search

Figure 22: Advanced options search

For example, if we want a dialog component written in JavaScript since December 2015, we might use the following search string

dialog created:>2015-12-15 language:JavaScript

You can use the search option screens to build the syntax dynamically, or you can simply type in the syntax and get the same results.

Repositories options

Similarly, you can restrict the repositories you are interested in searching.

Repository search options

Figure 23: Repository search options

You can limit the search to minimum or maximum number of stars and/or forks. You can also restrict the size of the repositories and the date of the latest push.

For example, to find a JavaScript Timezone library used by lots of people, we might use the following syntax:

timezone language:javascript stars:>500

By combining options, you can narrow down the results returned to just solutions for your application needs.

Tip: Although you can create some pretty large search requests (such as all projects with over 500 stars), you should generally include at least one search word in addition to advanced search options.

As you get comfortable with the search options, you can enter the search text directly without using the advanced search parameter screens.

Tip: Remember, the keywords (stars, language, etc.) all end with a : (colon). Searching for “stars>500” will return no results, but “stars: >500” will work.

Search text options

The following options are available to search the repositories via the search text.

Numeric searching

The size: and forks: and stars: keywords are all numeric based, so you can search using basic comparison operators.

Keyword: numeric

This option finds the exact match (size, number of stars, or forks). It isn’t likely you’ll know the exact amount for any of the keywords, but it will work for you.

Keyword: >= numeric

This searches for any value greater or equal to the indicated values (use just > to not include the numeric value). For example:

stars:>500

This syntax returns just those repositories that have more than 500 stars.

Keyword: <= numeric

Conversely, the <= (or <) operator restricts how large of a value to return. If you are looking for project with only a few forks (suggesting a somewhat stable project), you might use the following:

forks: <10

Keyword: low..high

This finds matches between the specified low and high range (including the boundaries). For example:

size: 75000..150000

This syntax will return repositories between 75 and 150 MB in size.

Scope searching

The scope operator IN lets you search for text in the repository name, its description, or in the readme.md file (or any combination of the three). The general syntax is:

<search target> in: name, description, readme

For example, I might use the following to search for the readme.md files to find any JavaScript code that describes dialogs:

dialog in:readme language:javascript

To search both name and readme, include both after the in: operator, separated by a comma.

Date searching

When searching repositories, you can use the keyword created: to search the creation date and pushed: to search the last updated date. You can use it with the greater than, less than, or range operators. For example, to find repositories containing the text Bootstrap that were updated after December of 2015, you could use the following:

Bootstrap pushed:>2015-12-01

Similarly, to find all CSS repositories created during 2015, you could use the following:

css created:2015-01-01..2015-12-31

Summary

Multiple operators can be combined in one search; only repositories matching all conditions will be returned.

Scroll To Top
Disclaimer
DISCLAIMER: Web reader is currently in beta. Please report any issues through our support system. PDF and Kindle format files are also available for download.

Previous

Next



You are one step away from downloading ebooks from the Succinctly® series premier collection!
A confirmation has been sent to your email address. Please check and confirm your email subscription to complete the download.