Git Folder Manager
Push a folder, a file, or any multi-selection to GitHub straight from the VS Code Explorer — without pushing the whole project.
Git pushes commits, not folders. Git Folder Manager stages only the selected paths, commits them with your message, and pushes that commit. Other staged work is left exactly as it was.
Use it
Right-click in the Explorer:
| On a… |
You get |
| Folder |
Push Folder to GitHub · Select GitHub Repository · View Git Status · Open Git Folder Manager |
| File |
Push File to GitHub · View Git Status · Open Git Folder Manager |
| Multi-selection |
Push Selected Files and Folders |
| Workspace root |
Push Workspace |
Every command is also in the Command Palette under Git Folder Manager: (Push Folder/File/Selected Files/Workspace, Select Repository, Select Branch, Create Repository, View Git Status, View Changes, GitHub Login / Logout, Open Settings, Reset Dialog Preferences).
What happens on a push
- Find the Git repository for the selection (all items must be in one repo).
- List the changes inside the selection (new, modified, deleted, renamed).
.gitignore is respected.
- Warn about sensitive files (
.env, private keys, tokens).
- Sign in with VS Code's GitHub account if needed.
- Pick the repository and branch (remembered per project).
- Verify you can push to that repository.
- Enter a commit message (required; suggestions + history).
- Review the summary — Review Changes… lets you untick files and open diffs.
- Stage only the selection, commit only those paths, push. Retry on failure; cancel while pushing.
Settings
| Setting |
Purpose |
confirmBeforePush |
Ask before committing and pushing |
defaultBranch |
Default target branch (empty = current local branch) |
defaultCommitMessage |
Default message (empty = auto, e.g. "Update Navbar.tsx") |
autoStageSelectedFiles |
Stage the selection automatically (off = only already-staged files in the selection) |
showProgress |
Progress notification (off = status bar) |
rememberRepository |
Remember repository + branch per project |
showSensitiveFileWarning |
Warn before pushing secrets |
enableFilePush / enableFolderPush / enableMultiSelectPush |
Turn push types on/off |
dontAskAgain.pushConfirmation / .repositorySelection / .commitConfirmation / .permissionReminder |
Persistent "Don't ask again" choices |
Don't Ask Again only hides the optional dialog. It never skips GitHub sign-in, repository access checks, the sensitive-file warning, or the prompt for a branch that doesn't exist yet. Reset with Reset Dialog Preferences.
Safety
- No tokens in code: authentication uses VS Code's built-in GitHub provider; the token is passed to git through its environment for a single push and never stored by the extension.
- Never force-pushes. A rejected (non-fast-forward) push tells you to pull first.
git push sends your current HEAD, so earlier unpushed local commits go along with it; the confirmation dialog tells you when that applies.
- "Select Branch" chooses the GitHub branch to push to; it does not switch your local checkout. A new branch name is created on GitHub by the push.
- VS Code does not let extensions sign an account out. GitHub Logout explains where to do it and can clear what the extension remembers.
Develop
npm install
npm run compile
# press F5 to open the Extension Development Host
Build a package:
npx vsce package
code --install-extension git-folder-manager-1.0.0.vsix
Set publisher in package.json before packaging. Requires Git on your PATH and VS Code 1.85+.
Project layout
src/
extension.ts command registration
commands/ push*, select*, createRepository, viewStatus, openManager, account, pushPipeline
git/ gitService, gitStatus, gitStaging, gitCommit, gitPush
github/ githubAuth, githubApi, repositoryService, branchService
dialogs/ commitDialog, pushConfirmation, permissionDialog, repositoryDialog
security/ sensitiveFileCheck, permissionManager
settings/ configuration
utils/ fileUtils, workspaceUtils, errorHandler, progress