Reputation: 89
When I use the search on VS Code, it searches all the git branches I have. Is there a way to only search the current active git branch?
Upvotes: -1
Views: 1699
Reputation: 1
I have the same situation.
The search pane shows the filename with commit number added:
When I click on а search result, the title of opened tab contains the filename and the commit number also:
I have noticed that searching a keyword from a code editor opened for comparing a file from different branches, searches in that branches also.
Searching for a keyword from a code editor when the opened file is from the HEAD, the search results are only from the HEAD, so the above results does not appear.
Upvotes: 0
Reputation: 1324947
The VSCode search across file allows you to quickly search over all files in the currently opened folder, with Ctrl+Shift+F.
Only the file currently available in your workspace (which can be your Git cloned repository working tree) are searched.
Upvotes: 4