Keep every git submodule in your workspace fast-forwarded — automatically.
A focused VS Code extension that scans the workspace for .gitmodules files,
discovers every declared submodule, and runs git fetch + git merge --ff-only
on each one. Runs on startup, on a keybinding, or from the Command Palette.
- Author: Dr. Farshid Pirahansiah — https://pirahansiah.com
- Publisher:
pirahansiah - Extension ID:
pirahansiah.farshid-autoupdate-gitmodule
Features
- Auto-scan every
.gitmodulesin the workspace (configurable excludes). - Parallel pulls with adjustable concurrency (default 3) — fast on workspaces with many submodules.
- Fast-forward only — never silently merges or rewrites history.
- Cancellable progress notification.
- Status bar summary with click-to-run.
- Detached HEAD safe — skips submodules with no upstream branch.
- Local-path safe — passes
-c protocol.file.allow=alwayssofile://submodules work. - Per-submodule timeout so a hung remote can't freeze the workspace.
- Output channel Auto-Update GitModule logs every command and result.
Commands
| Command | Title |
|---|---|
farshidAutoupdateGitmodule.updateNow |
Auto-Update GitModule: Update Submodules Now |
farshidAutoupdateGitmodule.showOutput |
Auto-Update GitModule: Show Output Log |
Default keybinding: Cmd+Alt+F12 (macOS) / Ctrl+Alt+F12 (Win/Linux).
Settings
| Key | Default | Description |
|---|---|---|
farshidAutoupdateGitmodule.runOnStartup |
true |
Pull all submodules when the workspace opens. |
farshidAutoupdateGitmodule.confirmBeforePull |
false |
Ask before pulling on startup. |
farshidAutoupdateGitmodule.allowFileProtocol |
true |
Allow file:// / local-path submodule URLs. |
farshidAutoupdateGitmodule.showNotifications |
true |
Show success/failure notifications. |
farshidAutoupdateGitmodule.showStatusBar |
true |
Show a status bar item with the last result. |
farshidAutoupdateGitmodule.concurrency |
3 |
Max submodule pulls to run in parallel (1–16). |
farshidAutoupdateGitmodule.exclude |
["**/node_modules/**"] |
Globs to ignore when scanning. |
farshidAutoupdateGitmodule.timeoutSeconds |
120 |
Per-submodule timeout for fetch + merge. |
How it behaves
For each declared submodule the extension:
- Verifies the working copy exists and is initialized (has a
.gitentry). - Reads
HEAD. If detached, the submodule is skipped (counted asdetached, not failed). git fetch --prune origingit merge --ff-only @{u}
It does not stage or commit the submodule pin in the parent repo — that's intentional; you decide when to bump the pin.
Build & develop
npm install
npm run esbuild # bundle once
npm run esbuild-watch # bundle in watch mode for F5 dev host
Open this folder in VS Code and press F5 to launch the Extension Development Host.
Package & publish
npm run vsix # produces farshid-autoupdate-gitmodule-X.Y.Z.vsix
vsce publish -p $VSCE_PAT # publish to Marketplace
vsce:prepublish runs npm run package (esbuild minify) automatically.
License
MIT — see LICENSE.