Worktrees
Make one
mia new due-datesmakes the branch (from base if set), a worktree next to the repository
(~/src/shop.monduli), and a name. It copies clone files from the main
checkout and runs setup. If the branch is already checked out somewhere,
you get that worktree.
| flag | does |
|---|---|
--shell | attach to its session after |
--on <machine> | start its environment on that machine |
--pr <number> | check out a pull request |
--stack | a stack layer instead |
mia adopt <path> takes over a worktree you made with git worktree add.
Find and go
mia ls # every worktree; ★ starred, dirty, session, +ahead −behind
mia shell monduli # attach to its session
mia switch monduli # cd there
mia open monduli # open it in your editor
mia path monduli # print its pathSessions and windows
Each worktree has a tmux session, mia-<name>. It keeps running when you
close the terminal.
mia window # its windows
mia window new monduli # a new shell
mia window new monduli --editor # your editor
mia window new monduli logs -- tail -f log/dev.log
mia window read monduli logs # what it shows
mia window send monduli logs -- q # type a line into it
mia window close monduli logsName windows you start often under [launch] in the config, then
mia window new monduli logs.
Names
Each worktree gets the name of a place, like monduli. A place is easier to
remember than a branch or a number ("the fix is in monduli"), short enough to
say and type, and it stays the same while the branch inside changes.
mia's own places are neighbourhoods of Arusha, Dar es Salaam and Nairobi. Use
places you know instead — the streets you grew up on, cities you have lived
in — in ~/.config/mia/config.toml:
names = ["kariakoo", "brooklyn", "shinjuku", "camden"]mia hands out yours first, then its own. A name is lowercase letters, digits and hyphens, because it becomes a hostname and a tmux session.
Stars, setup
mia rename monduli billing # a name you choose
mia star monduli # keep it at the top of the dashboard
mia setup monduli # run setup again
mia run monduli make test # run a command in itRemove
mia rm monduliremoves the worktree, its session, its environment and its name. It refuses
when there are uncommitted changes (--force discards them) or a session is
running (--stop-running stops it).
mia gc # worktrees untouched for 14 days
mia gc --apply # remove themPull requests
mia never pushes. mia pr drafts a pull request and prints the commands for
you to run:
mia pr monduli # preview
mia pr monduli draft # save to .git/mia/pr/<branch>.md