Link to extension in marketplace https://marketplace.visualstudio.com/items?itemName=vradchuk.git-smart-checkout
git-smart-checkout
is a vscode extension that adds a new command Git: Checkout to ... (With stash)
to command palette that allows to choose stash strategy at checkout.
Comments and contributions are very welcome!
In fast-paced development environments, switching between Git branches is a frequent but often disruptive task. Developers may have uncommitted changes that block a checkout, leading to tedious manual stashing and the risk of losing or misplacing changes. This common friction interrupts focus, breaks workflow, and slows down productivity.
The git-smart-checkout
VSCode extension was created to eliminate that pain. It provides a seamless way to automatically stash and restore changes when switching branches—so developers can stay in the flow, move confidently between tasks, and trust that their work is safe.
Our goal is simple: make Git smarter, so you don’t have to think about it. git-smart-checkout
reduces context-switching overhead and gives developers back valuable time and mental clarity. No more “local changes would be overwritten” errors—just smooth, uninterrupted development.
This mode is useful if you need to keep stash with your branch.
In this mode, extension creates a automatic stash for the current branch (let's call it branch_1
) before switching to new branch branch_2
.
When you switch back to branch_1
with this mode, stash for this branch will be popped automatically.
This mode is helpful if you need to transfer your changes to a new branch after checkout. In this mode, extension creates a stash from working directory, switches to a new branch and then pop the stash.
This mode is helpful if you need to transfer your changes to a new branch after checkout but want to keep the changes with original branch where changes were originally made. In this mode, extension creates a stash from working directory, switches to a new branch and then apply the stash, e.g. add stashed changes but does not remove them from stash stack.
Tip
stash created with this mode is not compatible with the stash created by mode Auto stash in current branch
, this means that it want be used to automatically restore. This stash might be used for manual access if needed.
Tip
you could set default auto stash behavior when using Checkout to ... (With Stash)
command by changing default mode in status bar. If set to manual, you will be prompted to select auto stash mode after each checkout, otherwise selected auto stash strategy will be used by default.
This mode is just ordinary checkout without any auto stash functionality.
The extension provides a convenient Pull with stash feature. When you run this command, your uncommitted changes are automatically stashed before pulling updates from the remote branch. After the pull completes, your changes are restored. This ensures a smooth workflow and prevents conflicts or loss of local changes during a pull operation.