JB Commit PanelA JetBrains-style Git tool window for VS Code: Local Changes with the diff right in the panel, Commit Changes and Push Commits dialogs, Stash, and a Log with the commit graph. Local Changes
The Commit Changes dialog opens above the whole window. Drag it by its title and resize it; next time it opens at the same size. It has:
Exactly the checked files are committed, whatever is staged in the index. Commit message hints, like JetBrains' commit message inspections: a wavy underline where the subject line (the first line) or a line of the body is longer than 72 characters, or where the body starts right below the subject without a blank line; hover it to see why. A thin line shows the right margin. The limits are settings ( Commit Checks run before the commit, on the files being committed. They are off until you turn them on, and are remembered per workspace:
When Analyze code or Check TODO finds something, the commit waits: Review lists what was found and goes to it, Commit Anyway commits. Parts of files (see below) aren't changed by the checks. Commit part of a file: uncheck a change in the diff and the commit leaves it out. The change is drawn as an outline instead of being filled, and the file's checkbox in the list shows that only part of the file goes in. Your file doesn't change: the left-out changes stay in it as local changes. Click the file's checkbox to check all its changes again; check a change of an unchecked file to commit just that change. Parts of files can't be committed while a merge, cherry-pick or revert waits to be committed. Select several files with Shift-click or ⌘-click: Commit, Rollback, Add to VCS, Delete, Jump to Source and Copy Path then work on all of them, and Space checks or unchecks them together. The context menu of a file also has Rollback…, Stash Changes…, Create Patch… and Copy as Patch to Clipboard (unversioned files go in as new ones), Show Diff in Editor, Jump to Source, Show History, Annotate with Git Blame, Local History, Copy Path, Reveal in Finder / Explorer, Add to VCS for unversioned files, Add to .gitignore and Delete… (moves the file to the trash). The panel's "…" menu has Apply Patch… and Apply Patch from Clipboard…: they show the files a patch changes, then apply it to your working tree without committing anything (what doesn't apply cleanly opens the Conflicts dialog). Manage Remotes… is there too: add a remote, change its name or URL, remove it. Prefer the commit form inside the panel? Turn on Use non-modal commit interface ( Stash
PushPush… (⇧⌘K anywhere except the text editor, where ⇧⌘K stays Delete Line) opens the Push Commits dialog above the whole window:
⇧⌘K, then Enter pushes right away. A branch without an upstream starts tracking the branch it is pushed to. When the remote has commits your branch doesn't, the push is rejected: choose Merge or Rebase, and the push runs again. Push… is also in the context menu of a branch in the Log. Push All up to Here… (right-click a commit of the current branch in the Log) opens the same dialog for the commits up to that one: the newer ones stay local. Branches, Update Project, Pull, MergeBranches… (the branch icon in the panel's title, the command palette) opens the Git Branches popup, as in JetBrains IDEs: Update Project…, Commit…, Push…, New Branch… and Checkout Tag or Revision… on top, then the local and remote branches and the tags. Favorites come first; ★ on a row marks or unmarks one. A local branch shows ↑ and ↓ for the commits it has to push and to pull. Type to search; Enter on a branch shows what to do with it: Checkout, New Branch from…, Checkout and Rebase onto…, Compare with…, Show Diff with Working Tree, Rebase … onto…, Merge … into…, Pull into … Using Merge or Using Rebase (a remote branch), Update, Push…, Rename…, Delete. To have the current branch in the status bar open this popup, turn on Update Project… (⌘T in the Git panel, the panel's "…" menu, the popup) brings in the new commits of the current branch's upstream: merge them into it, or rebase it on top of them. The choice is remembered. Your local changes are put aside meanwhile and come back. Pull… and Merge… (the panel's "…" menu, the command palette) open their dialogs: the branch, and the options of Log
Branch actions (right-click a branch): Checkout, New Branch from Selected…, Checkout and Rebase onto Current Branch, Compare with Current Branch, Show Diff with Working Tree, Rebase Current Branch onto Selected, Merge into Current Branch, Update, Push…, Rename…, Delete, Mark / Unmark as Favorite. The toolbar next to the branches has New Branch, Update, Delete, Compare, ★ and Fetch. Tag actions (right-click a tag): Checkout, New Branch from Selected…, Compare with Current Branch, Show Diff with Working Tree, Merge into Current Branch, Push Tag… and Delete Tag (then Restore brings it back, Delete on Remote… deletes it on a remote too). Remote actions (right-click a remote): Fetch, Edit Remote…, Remove Remote…. Compare with Current Branch shows the commits of the branch that the current one doesn't have; ⇄ Swap shows the other way round, × ends the comparison. Show Diff with Working Tree (a branch) and Compare with Local (a commit) open the diff window with every file that differs from your working tree. Commit actions (right-click a commit): Copy Revision Number, Create Patch…, Show Diff, Compare with Local, Cherry-Pick, Checkout Revision, Reset Current Branch to Here…, Revert Commit, Undo Commit…, Edit Commit Message… (F2), Fixup…, Squash Into…, Drop Commit…, Interactively Rebase from Here…, Push All up to Here…, New Branch…, New Tag…, Go to Child Commit, Go to Parent Commit. With several commits selected: Copy Revision Numbers, Create Patch… (one file, oldest commit first), Show Diff, Compare Versions (two commits: the diff from the lower one to the upper one, even on different branches), Cherry-Pick (oldest first), Revert Commits (newest first), Drop Commits… and Squash Commits…. Squash Commits… asks for the message and makes one commit at the place of the oldest selected one; the commits between them stay, after it. A cherry-pick or revert that stops on a conflict goes on with the rest of the commits after Continue. Files of a commit (right-click a file in the changes of the selected commit, or of several selected commits together): Show Diff, Compare with Local, Compare Before with Local, Jump to Source (F4), Open Repository Version, Revert Selected Changes and Cherry-Pick Selected Changes (they change your working tree and commit nothing; what doesn't apply cleanly opens the Conflicts dialog), Create Patch…, Get from Revision (asks first), History up to Here, Copy Path, Copy Absolute Path. Interactively Rebase from Here… opens a dialog with the commits from the selected one up to the latest, newest first like the log. Mark each one Pick, Edit, Reword, Squash, Fixup or Drop (P, E, R, S, F, D), and move them with ⌥↑ and ⌥↓. Edit stops the rebase right after that commit: the bar above Local Changes says so; change the files, and Continue puts the changes into that commit (it asks first) and goes on. Squash and fixup go into the kept commit below them; with several commits selected, into the oldest of them. The message of a reworded or squashed commit is edited below the list. Start Rebasing runs it. With git's Fixup… and Squash Into… put your local changes into an older commit. The Commit Changes dialog opens with the message "fixup! " (or "squash! "). Commit and Rebase… (⌘Enter) commits it and opens Interactive Rebase with it already under that commit, so Start Rebasing folds the changes in; Commit in the Commit ∨ menu makes the commit and leaves it for later. A squash adds its message to the commit's message (without the "squash!" line); a fixup keeps the commit's message. Anything that rewrites history or deletes data asks first. Editing commits that are already pushed warns that the branch will need a force push. The log refreshes by itself when branches, tags or HEAD move. HistoryShow History opens a History tab in the Git panel, as in JetBrains IDEs: the commits that changed a file, newest first and following renames (older commits show the name the file had), the file's diff in the selected commit and its message. Find it under Git in the context menu of the editor and of a file in the Explorer, in the menu of an editor tab, on a changed file in Local Changes and in the command palette. Right-click a commit for Compare with Local, Open Repository Version, Revert or Cherry-Pick Selected Changes, Get from Revision, Show All Affected Files (the commit in the Log), Copy Revision Number and more. Enter or a double-click opens the commit's diff window, F4 the file; × closes the tab. Annotate with Git Blame (the same Git menu) turns on VS Code's own Git blame in the editor, and Local History › Show History opens VS Code's Timeline of the file, Put Label… saves a named Local History entry of it. Show History for Selection does the same for the selected lines, and History up to Here (a file of a commit in the Log) starts at that commit. Compare with Revision… and Compare with Branch… (Git menu, command palette) open the diff window with the file as a commit of its history or a branch has it against your working file. ConflictsWhen a merge, rebase, cherry-pick, revert or stash stops on conflicts, the Conflicts dialog opens, as in JetBrains IDEs. It lists the files in conflict and what each side did to them: Yours is your branch, Theirs is what comes in (in a rebase, Yours is the branch being rebased). Accept Yours or Accept Theirs takes one side for the selected files, even several at once; a side that deleted the file deletes it. Merge… (Enter, double-click) opens VS Code's three-way merge editor for the file; when you close it, the dialog comes back with what is left. When nothing is left in conflict, the dialog closes and offers to Continue the rebase (cherry-pick, revert) or to Commit… the merge, with the message git prepared. The dialog opens again from Resolve next to Merge Conflicts in Local Changes, Resolve… in the bar above them, Resolve Conflicts… in the context menu of a conflicted file, and in the command palette. Rebase, merge and cherry-pick that stopWhen a rebase, merge, cherry-pick or revert stops, a bar above Local Changes says so ("Rebasing feature onto main (2/5)") and what to do next: resolve the conflicts (Resolve…), then press Continue (the resolved files are marked resolved for you), or Skip the commit (rebase), or Abort. A merge is finished by committing. The bar also appears when the operation was started outside VS Code, and the same actions are in the command palette. KeyboardOn Windows and Linux use Ctrl instead of ⌘ and Alt instead of ⌥.
RequirementsVS Code 1.90 or newer and git. The dialogs and the diff window open above the window in VS Code versions with modal editors (the LicenseMIT. The licenses of the bundled open-source libraries are in ThirdPartyNotices.txt, which comes with the extension. |