Using GitHits

GitHits doesn't list results like a traditional search engine. Instead, it understands what you're trying to accomplish and provides you a single canonical code example that solves your problem.

Getting Access

Visit app.githits.com and sign in with your GitHub account. GitHits is currently in private beta.

Searching

  1. Select the programming language you're working with
  2. Enter your query in the search bar

Type what you're looking for in the search bar. GitHits understands natural language, so describe what you're trying to do. Think more like a question that you would ask from project maintainers, your team, or in Stack Overflow. Make sure to mention the specific technologies you're using, such as frameworks, libraries, methods, error messages, etc.

Good queries are specific:

  • "JWT authentication in Express with TypeScript"
  • "Debouncing search input in React hooks"
  • "Handling CORS errors in Next.js API routes"

Vague queries like "authentication" or "React components" are unlikely to return useful results.

Understanding the Results

GitHits providers three views to the results:

  1. Sources: The best matches that directly address your query
    • Each source shows the repository it came from, its license (SPDX ID), and why it's relevant. Expand any result to see the full context, including surrounding code and related discussions. You can click through to the original GitHub source if you want to explore further.
  2. The example: A distilled code example that combines the best parts from the sources into a single, coherent snippet
    • This is generated by analyzing the top results and extracting the most relevant patterns. The example is meant to be the best, token-efficient way to give context to your AI coding assistant.
  3. The Explanation: A natural language summary of how the example works and what was taken from the sources
    • This helps you understand the reasoning behind the example, so you can adapt it to your specific needs. This is only provided in the UI, MCP result does not include explanations.

Results are ranked by how well they solve your problem, not just by popularity. A well-crafted example from a smaller project might rank higher than a messy one from a popular repository.

License Filtering

By default, GitHits filters out copyleft-licensed code from search results (strict mode). This helps you avoid accidentally incorporating code with restrictive license requirements.

You can change this behavior in your account settings under Preferences:

ModeBehavior
Strict (default)Excludes copyleft-licensed results
YOLONo filtering — all results included regardless of license
CustomYou manage a personal blocklist of specific SPDX license IDs to exclude

Each source in the results shows its license SPDX ID, so you always know what license applies.

If the initial results aren't quite what you're looking for, try refining your query:

  • Add more specific details about your use case
  • Mention particular libraries, frameworks, or versions
  • Include error messages or specific methods you're working with
  • Use synonyms or alternative terms for concepts