Views and search
The GitDB views in the activity bar, switching branches and tags, merging, and finding code with GitDB's search commands.
The GitDB views
Click the GitDB icon in the activity bar. Before you connect, it shows a Connect to GitDB button. Once you're connected, it shows four views: Files, Refs, History, and Repos.
These views don't update on their own when something changes somewhere else, such as on gitdb.co, from an AI agent, or on another computer. To reload them, click the refresh icon in any view's title bar, or run GitDB: Refresh. Refreshing reloads all four views and any GitDB files you have open.
Files
Files shows the files and folders on the current branch or tag, with folders listed first. Click a file to open it in the editor. Files with pending changes carry a label, as described in Edit and commit.
- Title bar: New File, New Folder, Open Terminal, Refresh, and Collapse All.
- Right-click: GitDB: New File, GitDB: New Folder, and GitDB: Delete.
Refs
Refs has two groups, Branches and Tags. Each row shows the name and a short commit ID. Clicking a row doesn't switch to it. Right-click it instead.
- Right-click a branch for these options:
- GitDB: Switch to This Branch
- GitDB: Merge Into Current Branch (see Merging)
- GitDB: Create Tag, which tags that branch's latest commit
- Right-click a tag and choose GitDB: Switch to This Tag.
- Click + on the Branches header (GitDB: Create Branch) to create a branch from the current branch. The new branch starts at the current branch's latest commit. You stay on the current branch.
- Click + on the Tags header (GitDB: Create Tag) to create a tag. Pick one of the 50 most recent commits on the current branch, then type the tag name.
Switching branches and tags
When you switch, the Files view, Source Control diffs, caller counts, and any open GitDB files reload for the new branch or tag. You'll see GitDB: Switched to branch '…' (or tag '…').
You can also switch by clicking the repository and branch in the status bar, or by running GitDB: Switch Branch. Both open a list of every branch and tag, shown by full name, such as refs/heads/main or refs/tags/v1.0.0.
Keep these in mind:
- Tags aren't read-only. After you switch to a tag, the editor still lets you change files. Switch back to a branch before you make changes.
- Pending changes stay with you when you switch. See Switching branches with pending changes.
Merging
To merge a branch into the branch you're on, right-click it in Refs and choose GitDB: Merge Into Current Branch, then confirm Merge. The result appears as GitDB: Merge source → target: result. The result is one of these:
| Result | Meaning |
|---|---|
success | The branches were merged, and a merge commit was created on the current branch. |
fast_forward | The current branch was moved forward to the merged branch's latest commit. |
already_up_to_date | There was nothing to merge. |
conflicts | The branches have conflicting changes. Nothing was merged. |
The extension has no conflict-resolution view. If a merge reports conflicts, edit the conflicting files on one of the branches so they no longer conflict, commit those fixes, and then merge again.
You can't merge a branch into itself.
History
History lists the repository's commits starting from its HEAD, 20 at a time. Click Load more… at the bottom to see older commits.
- Each row shows a short commit ID and the first line of the message. Next to it are any branches or tags that point at the commit, plus the author and how long ago it was committed. Hover over a row for the full ID, date, and message.
- Click a commit to open its details, including the ID, author, date, parent, message, and file tree, as a read-only document.
- Right-click a commit and choose GitDB: Copy Commit ID to copy its full ID.
History doesn't change when you switch branches. To see the commits on the branch you're on, run log in the GitDB terminal.
Repos
Repos lists up to 20 of your most recently updated repositories. Each row shows organization/name, the repository's visibility and default branch, and a current marker on the one you're connected to.
- Right-click a repository and choose GitDB: Switch to This Repo to switch to it.
- Click the search icon (GitDB: Search Repos…) to find any repository you can access by name.
See Switch repositories for what switching does.
Status bar
When you're connected, the status bar shows GitDB: organization/name @ branch | MCP: running. Click it to switch branches. When you're not connected, it shows GitDB: Not connected. Click it to connect.
Search your code
GitDB files aren't part of a workspace folder, so VS Code's Explorer and Search views don't show or search them. Use the GitDB commands below instead. Run them from the Command Palette while you're connected. They all search the branch or tag you're currently on.
| Command | What it does |
|---|---|
| GitDB: Find Function | Type a function name. If there's one match, the file opens with the function selected. If there are several, you pick one from a list that shows each match's file, line, and signature. |
| GitDB: Find Callers | Lists the functions that call a function. In a GitDB file, it uses the word under your cursor. Otherwise, it asks for a name. Pick a caller to jump to it. |
| GitDB: Search Files | Finds files by name using a glob pattern, such as *.rs, auth*, or src/**/*.ts. Shows up to 50 results. |
| GitDB: Grep | Searches file contents with a regular expression, such as fn handle_ or pub async fn. The search is case-sensitive and shows up to 50 matches. Pick a match to open the file at that line. |
When there are more results than the list can show, the list's prompt ends with (truncated). Make your search more specific to narrow it down.
GitDB: Find Function, GitDB: Find Callers, and the caller counts described below use the repository's AST index. If they find nothing for code you know exists, check that the repository shows AST indexed on gitdb.co. See AST indexing.
Caller counts above functions
When you open a GitDB file, each function gets a caller count above it, such as 3 callers. This is a CodeLens. Click the count to list the callers, the same as GitDB: Find Callers. If a count can't be loaded, it shows callers: ... instead.
You can adjust caller counts in your settings:
| Setting | Default | What it does |
|---|---|---|
gitdb.codelens.enabled | true | Turns caller counts on or off. |
gitdb.codelens.debounceMs | 500 | How long to wait, in milliseconds, before looking up a count. |
gitdb.codelens.cacheTtlSec | 60 | How long to remember a count, in seconds, before looking it up again. |