showgit
v0.2.6
Published
Clickable Git source control panel for the terminal, with multi-repository support (works in cmd, PowerShell, Windows Terminal, macOS and Linux).
Maintainers
Readme
showGit
A clickable Git panel for your terminal, in TypeScript. Open a project folder, type showGit,
and click to see changes, stage, unstage, discard, commit, fetch, pull, push, switch branches,
stash and view history. Run it one level above and every Git project inside appears in the
same panel, one section each. Works in Command Prompt, PowerShell, Windows Terminal, macOS and
Linux. No runtime dependencies.
Install (Windows, macOS, Linux)
Needs Node.js 18+ and Git 2.23+.
npm install -g showgit-0.1.0.tgzRun that in the folder where you saved the file. Then, in any project:
cd path\to\project
showGitUpdate: install the new .tgz the same way. Remove: npm uninstall -g showgit.
If the folder is not a Git repository, showGit tells you to go to your project folder (and lists Git projects found inside the current folder).
Using it
If the folder you start in is not a repository itself, showGit shows every Git project inside it on one screen: one section per repository, each with its own commit box, staged/changes lists and buttons. Click a section, or one of its files, to make it the active one; the toolbar, keyboard actions and diff panel then act on that repository. The arrow next to a repository name collapses its section.
Click any button. Everything also works from the keyboard:
| Key | Action |
| --- | --- |
| Up / Down (k / j) | move between files, across all repositories |
| s or Space | stage / unstage the selected file |
| d | discard the selected file's changes (asks first, backup saved) |
| a / u | stage all / unstage all in the active repository |
| c | type a commit message for the active repository; Enter commits, Esc goes back |
| r | refresh (it also refreshes by itself every 5 seconds) |
| f / p / P | fetch / pull / push the active repository (Push offers to create a GitHub repository when none is set) |
| b / h | branches / history of the active repository |
| in Branches: Tab, Enter, or the merge button | merge the highlighted branch into the current one |
| z / Z | stash / pop stash in the active repository |
| PageUp / PageDown / Home / End / Left / Right, mouse wheel, Shift + wheel | scroll the changes (Shift + wheel goes sideways) |
| ? | help |
| q or Ctrl+C | quit |
File buttons: + stage, - unstage, x discard. Letters: M modified, A added, D deleted,
R renamed, U untracked, ! conflict.
To merge, click Branch (or press b): every other branch has a merge button, or press
Tab for merge mode and Enter on the highlighted branch. Merging asks first; a merge that ends
with conflicts leaves them for you to resolve in an editor, and the screen says so.
Long lines in the changes are not wrapped: press Left / Right, or hold Shift and turn the mouse wheel. The bar under the changes shows how much of a line is off screen.
Options: showGit [folder] [--no-mouse] [--version] [--help]
folder may be a repository or a folder that contains several repositories.
GitHub sign-in
The top-right corner shows Sign in to GitHub (or your account name once signed in).
Pressing Push on a repository with no remote asks for a repository name, then whether it is
Public or Private, creates it on GitHub, adds origin and pushes. showGit uses GitHub's
OAuth device flow: the browser opens, the code is copied to the clipboard, and you approve it on
GitHub.
GitHub requires every app to have its own OAuth App ID. This is a one-time setup:
Open https://github.com/settings/developers and click New OAuth App.
Use any name, homepage URL and callback URL (for example
showGit,https://github.com/dashboard; the device flow does not use the callback).Tick Enable Device Flow, create the app, and copy its Client ID.
Set the client ID where showGit can read it, then restart showGit:
Windows (Command Prompt):
setx SHOWGIT_GITHUB_CLIENT_ID your-client-idmacOS / Linux:
export SHOWGIT_GITHUB_CLIENT_ID=your-client-idOr put it in
config.jsonin showGit's config folder:{ "githubClientId": "your-client-id" }
The config folder is %APPDATA%\showGit on Windows and ~/.config/showgit on macOS and Linux
(override it with SHOWGIT_CONFIG_DIR). The access token is saved in that folder and is never
written into .git/config. Signing out from the top-right account name deletes it.
If you have not set up an OAuth App yet but are already signed in with the
GitHub CLI (gh auth login), the sign-in dialog offers
Use GitHub CLI and reuses that token instead.
Safety
- Discard asks first and copies the file to
.git/showgit-backup/before removing anything. If the file changed while the question was open, nothing is discarded. - Pull only fast-forwards, and merge only merges the branch you pick into the current one. Nothing is force-pushed, reset or rebased. The first Push to a repository without a remote creates a GitHub repository of the visibility you choose, then pushes to it.
- Git never waits for a password or editor inside the screen; failures show as a message.
- Network commands stop after 120 seconds, other Git commands after 60 seconds.
- Diffs are cut at 2,000 lines; files over 1 MB and binary files are not previewed.
- File names are cleaned of control characters before they are drawn.
- If showGit crashes, details are written to
.git/showgit-error.logand the terminal is restored.
Not in version 0.1
Resolving conflicts on screen, staging single lines, rebase, reset, clone, AI commit messages.
Troubleshooting
showGitis not recognised: close and reopen the terminal. If it still fails, runnpm config get prefixand make sure that folder is in your PATH.- PowerShell says "running scripts is disabled": run
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedonce, or use Command Prompt. - Clicks do nothing or print strange characters: use Windows Terminal (default on Windows 11),
or start with
showGit --no-mouseand use the keyboard. - Layout looks broken: enlarge the window to at least 60 x 16.
Development
npm install
npm run build
npm testTo build a standalone executable (no Node.js needed to run it):
npm run build:exeWindows gets release/showgit.exe; macOS and Linux get release/showgit. The executable is
built from the Node.js version that runs the command, so build it on the platform you want to
run it on. It still needs Git installed, and Windows may warn about the unsigned binary.
