Switch Git branches without manually stashing uncommitted changes first
Sync your branch with the remote, fetch, merge, push, and unstash, in one command instead of four
Set up git sw and git sync as native Git aliases so they work like built-in Git subcommands
Use the --verbose flag to learn which Git commands run under the hood for each Legit action
Legit is a command-line tool that wraps Git with a simpler set of commands designed for everyday workflows. Standard Git is powerful but has a steep learning curve and requires knowing the right combination of commands for common tasks. Legit takes inspiration from the old GitHub for Mac desktop app, which made Git more approachable by handling certain tedious steps automatically. The main commands cover the actions most developers reach for daily. The sw command switches branches and automatically stashes any uncommitted work before switching and restores it afterward, so you never get stuck with Git refusing to switch because you have local changes. The sync command does a stash, fetch, merge or rebase, push, and unstash all in one step, replacing a multi-command sequence with a single word. There are also commands to publish a branch to the remote server, remove it from the remote, and undo the last commit. Legit can optionally install itself as a set of Git aliases, so you can type git sw or git sync as if they were built-in Git subcommands. It also has a --verbose flag that shows the underlying Git commands it runs, which is useful for understanding what is happening or for learning Git itself. A --fake flag lets you preview the commands without actually running them. Installation is straightforward via pip on any platform, via Homebrew on macOS and Linux, or via a standalone Windows executable available on the releases page. No additional dependencies are required beyond Python.
← frostming on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.