Home > Net >  How to exclude header files when i search repositories in github?
How to exclude header files when i search repositories in github?

Time:10-18

Sorry for rookie question, I want to search a specific API in Github, but want to exclude every file match that has a .h at the end, how to do this? I set the filter to only C files, but that doesn't exclude .h files.

CodePudding user response:

If you are using Github Search Code API, and you want to remove a specific extension, add:

-extension:[your_extension]

Example: -extension:h to exclude all header files in your case

References:

API example:

https://api.github.com/search/code?q=org:google language:c -extension:h

This also works on Github Search UI: https://github.com/search?q=org:google language:c -extension:h

  • Related