You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hey all,
Using the API and running this query for example...
returns only myfile.json if it exists in the Master branch of the "myrepo" repo. I can't find any information on how to search within another branch.
How can I alter this search to search either a specific branch or the entire repo?
Thanks...
@StuMid the code search API only indexes the main branch so you're correct that you can only use this API with that branch to search file contents.
That said, you can use the src API to fetch files from any branch given that you know the filename.
You can use a branch name where it says "commit" but there is an annoying limitation that the branch name cannot contain a slash. If the branch name contains a slash you'd have to take a 2 step approach and first look up the commit of the branch using the branch API.
Reading the documentation seems like you also need to know the path in addition to the filename when using the src API you suggested isn't it? In 2023 isn't still an easy way to search for files in a given branch? Without knowing the full path of the file
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.