GitFocus is a plugin for JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, PhpStorm,
GoLand, RubyMine, RustRover β 2024.2 and newer) that hides what you are not working on. Pick a few
commits, directories, or files, and the Project view shows only the files that belong to them.
Big project, small task β see only the part of the tree the task lives in.
How it works
- Enable GitFocus. Nothing is filtered until you do; the switch is off after
installation. Off again restores the full tree.
- Capture what you're working on β select commits in the Git log, or
directories and files in the Project view, right-click β GitFocus and add
them to a filter. One click adds all your changed (or staged) files, so the view survives
the commit.
- Look at the Project view. It shows only those files and their directories,
plus (by default) your local changes and open tabs β each behind its own switch.
- Switch views, not setups. One Default Filter plus three named filters: keep
one per task or branch, enable several at once for their union, or Use Only This
for one of them. Clear Sources empties a filter, Reset Filter
returns it to defaults.
Features
- Filter by commits, directories, files, and local changes β combine any mix
of sources into one focused view. Local changes show in one of four modes (all changed
files, workspace only, staged only, none); open tabs stay visible while you want them to.
- A filter per branch β right-click a branch β Use GitFocus Filter for
This Branchβ¦. The filter is named after the branch, fills with the commits the
branch owns, and switches itself on whenever you check that branch out β off again when you
move away. Its sources are edited by hand only on that branch; from anywhere else it can
still be switched, renamed, re-designated, or reset.
- Named filters follow you across worktrees and clones β a named filter is
defined once and every window of the same repository sees it. Which filters are switched on
stays per project window, so two worktrees on different branches keep different views.
Nothing is ever written into your repository.
- Extra context, one switch each β show the files your visible files import
(one hop; Java, Kotlin, Python, JavaScript/TypeScript, PHP, Go, Ruby, Rust), sibling files
and directories, and root files and top-level directories to reach the rest of the
project.
- Look without committing to it β Temporarily Show Children
opens a filtered directory in gray italic so you can see what is inside; add the entries
you want to a filter, or clear the reveal and it is gone.
- Hiding never blocks navigation β Go to Definition landing on a hidden file
puts it on the tree first, so Ctrl+click behaves the way it does without GitFocus. Do it by
hand with GitFocus: Show in Project View, or switch the automatic part off.
- Show Diff from the tree β right-click a visible file to compare current vs.
staged, staged vs. HEAD, or what each filter commit did to it. When several commits touched
the file, All Commits spans them in one diff and Select Range⦠lets a
two-handle slider pick the first and last commit to compare.
- Run only the visible tests β right-click a test directory β
Run Focused Tests or Debug Focused Tests runs just the test
classes the tree shows (Java and Kotlin).
- Changed lines highlighted in the editor β Highlight Lines Changed by
Commits tints every row your filters' commits added or modified, and Highlight
Locally Modified Lines tints every row that differs from the last commit. Both are off
by default; each range also gets a stripe beside the line numbers and a mark on the
scrollbar, and the colors are yours to set in Settings β Editor β Color Scheme β
GitFocus.
- Tell windows apart β the main toolbar (new UI) shows the open directory name
as a colored chip; pick a fixed color, or end the directory name in a color name or palette
number (
web-blue, myrepo-3). The IDE's Window menu
lists each project as name [branch] in the same color.
- Switch windows and worktrees β the GitFocus tool window on
the left stripe (Alt+Shift+W, or
GFW in Find
Action) lists every open IDE window under Active windows, then the closed
worktrees of the repositories you use GitFocus in under Other, grouped by
repository. Rows lead with the branch in the window's chip color, with the directory name
dim at the right edge. Arrows move, Enter switches or opens, typing filters, and the X on an
open row closes that window.
- Scope and colors β a
GitFocus scope matches exactly what is
visible, usable in Find in Files, scoped inspections, and File Colors.
- It follows your task β GitFocus joins the IDE's own
Tools β Tasks & Contexts, so opening a task restores the view you were
using with it.
- Reachable from anywhere β every switch appears in Find Action (double-Shift,
type "git focus") with live On/Off state and accepts a shortcut in Settings β Keymap. The
GitFocus button in the Project view header holds the display switches, the capture actions,
and the Filters menu; the right-click GitFocus menu acts on what you
selected.
- Starting over β Clear Sources and Reset
Filter per filter; Reset All Filters and Settings⦠for everything
at once.
- Localized β English, Chinese (Simplified), Japanese, and Korean, with Polish
and Russian included; the IDE's display language selects the locale.
Use cases
Focus on a few commits
- Open the Git log (Alt+9 / β+9).
- Ctrl-click the two or three commits you care about.
- Right-click β GitFocus β Set as Default Filter.
- Turn on GitFocus β Enable GitFocus.
- The Project view now shows only the files those commits touched, plus your local changes
and open tabs.
Two branches, two views
- Right-click branch feature-a β Use GitFocus Filter for This Branchβ¦
and pick a filter; it fills with the commits the branch owns.
- Do the same for bugfix-b with another filter.
- Check out either branch β its view switches on, the other one off. Nothing to rebuild
after a checkout.
Run only the visible tests
- Focus on the commits or directories you are working on, so the test tree shows only the
classes that matter.
- Right-click the test directory β Run Focused Tests (or
Debug Focused Tests).
- Only the visible test classes run β not every class that happens to live there.
What's new
- Changed lines highlighted in the editor. Two new switches in the GitFocus
popup (the Project view header button), both off by default: Highlight Lines Changed by
Commits tints the whole row of every line your filters' commits added or modified, and
Highlight Locally Modified Lines tints every row that differs from the last commit.
The rows follow the code while you type, and each range also gets a gutter stripe and a
scrollbar mark. Colors are set in Settings β Editor β Color Scheme β GitFocus.
- A tool window for your worktrees and windows. The GitFocus
button on the left stripe lists, under Active windows, every open IDE
window, then under Other every closed worktree where GitFocus is switched on
or whose branch has a filter designated for it, plus the remaining worktrees of the
repository, so a checkout not yet using GitFocus is one click away. Both sections group by
repository. Rows lead with the branch and fit the tool window width; double-click focuses
the window or opens the worktree in a new one, the X on an open row closes that window, and
the right-click menu shows, closes, or opens it.
- Branch filters are edited on their branch. A filter designated for a branch
takes hand edits to its sources only while that branch is checked out; elsewhere the
editing rows are grayed out while switching, renaming, re-designating, and Reset Filter keep
working. The branch popup lists every named filter, even one created in another repository β
picking it resets it and makes it yours.
- Switch windows by keyboard. Alt+Shift+W
(or GitFocus β Show Worktrees) opens the worktrees tool
window with this window's row selected, so the cursor starts where you are. Arrows move,
typing filters, and the chord toggles the tab the way the IDE's own
Alt+digit tool-window shortcuts do.
- Branch and color in the Window menu. The project rows at the bottom of the
IDE's Window menu read
name [branch] and carry the window's chip color, so
same-named worktrees are tellable apart before you switch.
- Diff across several commits. Show Diff offers All Commits when two
or more filter commits touched a file, and Select Rangeβ¦ from three β a two-handle
slider picks the first and last commit to compare.
- A filter per branch. Right-click a branch β Use GitFocus Filter for
This Branchβ¦: the filter is named after the branch, fills with the commits that
branch owns, and switches itself on whenever you check the branch out. Switch branches and
the view follows.
Full change notes are on the
Marketplace listing.
Compatibility
Works in IntelliJ IDEA, PyCharm, WebStorm, PhpStorm, GoLand, RubyMine, and RustRover,
version 2024.2 and newer. One plugin, every IDE.
Not compatible with Rider, Android Studio, DataGrip, and DataSpell:
these IDEs replace or bypass the Project view that GitFocus filters, and the IDE refuses the install
at startup with its standard "conflicting module" notice.
Get it from the
JetBrains Marketplace, or
install it from your IDE: Settings β Plugins β Marketplace β βGitFocusβ.