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 sign in, it shows a Connect to GitDB button. Once you're signed in, it lists your repositories so you can pick one to connect to (see Install and connect). 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. The … menu has GitDB: Sign Out (see Sign out).
- 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, Refs, and History views, Source Control diffs, caller counts, and any open GitDB files reload for the new branch or tag. You'll see GitDB: Switched to branch '…'.
You can also switch branches by clicking the repository and branch in the status bar, or by running GitDB: Switch Branch. Both open a list of the repository's branches, each with its short commit ID. Tags aren't in that list: open a tag from the Refs view.
Keep these in mind:
- Tags are read-only. When you switch to a tag, you'll see GitDB: Browsing tag '…' (read-only) — switch to a branch to edit or commit, and the status bar shows the tag followed by (tag, read-only). While you browse a tag, saving a file in the editor is refused, and so are committing and merging. Switch to a branch to make changes.
- Pending changes belong to the branch you connected on. 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, and you can't merge while you're browsing a tag.
History
History lists the commits on the branch or tag you're on, 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.
When you switch branches or tags, History reloads for the new one.
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.
- When you're not connected, click a repository (or its plug icon, GitDB: Connect to This Repo) to connect to it.
- When you're connected, right-click a repository and choose GitDB: Switch to This Repo to switch to it, or click the search icon (GitDB: Search Repos…) to find any repository you can access by name.
- The title bar's … menu has GitDB: Sign Out.
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. If the extension's MCP server can't start or stops, MCP: running changes to MCP: failed or MCP: stopped. After you switch branches or tags, the status bar shows only the repository and the branch or tag. 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. |