Code search not showing (or searching) the default branch? #136854
-
Select Topic AreaQuestion BodyI'm having an usual, persistent issue; Whenever I use the code search functionality it only searches the repo on an arbitrary branch, not giving me any results for anything that has changed past that. When I select an item in search, it displays a gibbberish number of an unknown branch, which also changes each time I search, as seen here; Navigating the repo manually works fine and as expected, as does of course searching through any local copy. The main branch is set to default as expected, but isn't working. This issue is happening to me on any search I take in any repo, even random ones I have not contributed, and is effecting me across browsers and after having pruned github cookies already, so it feels like some weird account flag or setting. It's not the absolute end of the world, but it is extremely irritating. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
Hi @burgerenergy, thanks for your question. GitHub code search only indexes the default branch. The links produced by the results are permalinks to the Git tree when the result was indexed. We could link to the file in the default branch, but if the contents changed after your search, you wouldn't be able to find the match. By linking to the permalink, you'll always find what you searched for. You can change to the default branch (or any other branch) using the selector you highlight in your screenshot. |
Beta Was this translation helpful? Give feedback.
Hi @burgerenergy, thanks for your question. GitHub code search only indexes the default branch. The links produced by the results are permalinks to the Git tree when the result was indexed. We could link to the file in the default branch, but if the contents changed after your search, you wouldn't be able to find the match. By linking to the permalink, you'll always find what you searched for.
You can change to the default branch (or any other branch) using the selector you highlight in your screenshot.