sup does git stash && git pull && git stash pop with recovery (--abort and --continue).
sup -m 'here be dragons' also adds git commit -m 'here be dragons' && git push to the above.
sup is a command-line tool for safely synchronizing your local git repository with its remote, even when you have uncommitted or untracked changes. It automates the process of stashing, pulling, and restoring your work, and provides robust handling for conflicts and interruptions.
- 🗃️ Automatic stashing: Stashes all local changes (including untracked files) before pulling.
- ⬇️ Safe pull: Runs a
git pull(or equivalent) after stashing, then restores your changes from the stash. - ⚔️ Conflict handling: If a conflict occurs, you can resolve it and use
sup --continueto finish the operation. - 🛑 Abort support: If you want to roll back, use
sup --abortto restore your previous state and stashed changes. - 📝 State tracking: Remembers interrupted operations and prevents accidental data loss.
- 🚀 Commit and push: Provide commit message with
--message/-mflag to commit and push stashed changes, including hook support.
sup # Stash, pull, and restore changes
sup --continue # Continue after resolving a conflict
sup --abort # Abort and restore previous state
sup --message "Your commit message" # Stash, pull, restore, and commit with a message
sup -m "Your commit message" # Short form for --message
sup -m "Your commit message" --no-verify # Commit and skip pre-commit/pre-push hooks- Make local changes (even untracked files).
- Run
supto pull from remote (optionally provide--message/-mto commit+push changes at the end):- Your changes are stashed.
- The latest changes are pulled from the remote.
- Your changes are reapplied, then optionally committed and pushed with the provided message.
- If a conflict occurs:
- Resolve the conflict in your files.
- Stage the resolved files (
git add ...). - Commit the resolution (
git commit -m "resolve conflict"). - Run
sup --continueto reapply your stashed changes and finish the operation (including optional commit+push)
- If you want to cancel the operation:
- Run
sup --abortto restore your previous state and stashed changes.
- Run
- Stashes all local changes (tracked and untracked) with a special message.
- Pulls from the remote using either the git CLI or the
git2library. - Applies the stash back. If there are conflicts, the tool pauses and lets you resolve them.
- Tracks its state in
.git/sup_stateto allow safe abort/continue.
- Enables most simplified git flow of Trunk Based Development.
- Avoids losing or overwriting local changes during a pull.
- Handles complex scenarios (conflicts, untracked files, interrupted pulls) automatically.
- Makes it easy to recover from mistakes or interruptions.
Windows with Scoop
scoop install https://strowk.github.io/sup/scoop/sup.json, or if you already have it installed with scoop:
scoop update supPrepare repository like this:
curl https://raw.githubusercontent.com/strowk/sup/refs/heads/main/packages/debian/pubkey.asc | gpg --dearmor > strowk-sup.gpg
sudo install -o root -g root -m 644 strowk-sup.gpg /usr/share/keyrings/
rm strowk-sup.gpg
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/strowk-sup.gpg] https://strowk.github.io/sup any main" > /etc/apt/sources.list.d/strowk-sup.list'
sudo apt-get updateThen you can install (and update) the package with:
sudo apt-get install -y git-supIn bash shell run:
curl -s https://raw.githubusercontent.com/strowk/sup/main/install.sh | bashShould work in Linux bash, Windows Git Bash and MacOS. For Windows users: you might need to start Git Bash from Administrator.
By default the script would try to install sup to /usr/local/bin and would require sudo rights for that,
but you can disable this behavior by setting NO_SUDO environment variable:
curl -s https://raw.githubusercontent.com/strowk/sup/main/install.sh | NO_SUDO=1 bashSudo is disabled by default for Windows Git Bash.
Head to latest release, download archive for your OS/arch, unpack it and put binary somewhere in your PATH.
If your system/architecture is not supported by the script above, you can install Rust and install sup from sources:
git clone https://github.com/strowk/sup
cargo install --path ./sup