Lazygit/Q/In lazygit, what's a basic workflow for listing modified files in a worktree and then committing them on the worktree?
In Lazygit, what's a basic workflow for listing modified files in a worktree and then committing them on the worktree?
Answer
- AI/Response
- A git worktree is just another working copy of the same repo; Lazygit always shows that checkout's
git status in the Files panel. The basic loop is the same as in the main repo: see changed paths → stage → commit. - Work directly in the worktree (simplest):
cd into the worktree directory and run lazygit. The Files panel lists modified/untracked/staged files for that path. Stage with space (or a for stage all), optionally enter on a file for line/hunk staging, then c to commit staged changes (see Keybindings_en.md — Files and Main panel (staging)). - Stay in one lazygit instance (main repo checkout): use the list-panel tabs —
[ and ] cycle tabs until Worktrees is selected — pick the worktree and switch into it (lazygit rebinds the session to that worktree). Then open the Files panel again; it now reflects that worktree's working tree. Stage and c to commit as above. The dedicated Worktrees bindings (e.g. n new, remove d) are documented in the same Worktrees section. Creating a worktree from a branch is also described under Worktrees in the README (e.g. worktree options from the branches view). - Filter / refresh: / filters the current side panel; R refreshes git state if the list looks stale (global keybindings).
My Notes