config.md

Configuration

Global Config

Location: ~/.config/wt/config.lua

return {
    -- Path style for worktree directories
    branch_path_style = "nested",  -- or "flat"
    flat_separator = "_",          -- separator for flat style

    -- Remote URL templates (${project} is substituted)
    remotes = {
        github = "git@github.com:myuser/${project}.git",
        gitlab = "git@gitlab.com:myuser/${project}.git",
        codeberg = "git@codeberg.org:myuser/${project}.git"
    },

    -- Which remotes to add by default
    -- "prompt" = ask each time
    -- {"github", "gitlab"} = use these automatically
    -- nil = prompt if remotes exist
    default_remotes = "prompt"
}

Project Config

Location: .wt.lua in project root (alongside .bare/)

return {
    hooks = {
        -- Files to copy from source worktree
        copy = {"Makefile", "*.mk", ".tool-versions"},

        -- Files to symlink from source worktree
        symlink = {".env", ".env.local", "node_modules"},

        -- Commands to run in new worktree
        run = {"make deps", "npm install"}
    }
}