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:
- documentation about the extension param
- documentation about param exclusion
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