Shell Integration¶
Shell aliases¶
The simplest way to keep your existing muscle memory. Add to your .zshrc or .bashrc:
twig also has built-in short aliases (twig g, twig s etc.) if you prefer not to define shell aliases.
twig root — changing directory¶
twig root prints the repo root path but cannot change your shell's working directory — that requires a shell function:
Passthrough — using twig as a git replacement¶
With passthrough.enabled = true, any subcommand twig doesn't recognise is forwarded to git verbatim:
| ~/.config/twig/config.toml | |
|---|---|
Then alias git to twig in your shell:
Now everything works transparently:
Note
Passthrough is disabled by default. Enable it intentionally — forwarding unexpected subcommands to git is a one-way door if your config has a typo.
Windows (Git Bash)¶
The same aliases and shell functions work in Git Bash — paste them into ~/.bashrc. See the Windows guide for full setup.