List Git worktrees with branch details
Build a paste-ready command, then review its compatibility and effects before running it.
git worktree list --porcelainread-onlyno known side effects Compatibility
Linux + macOS + WindowsVerified for Linux, macOS, Windows using bash, zsh, powershell syntax.
Operational knowledgereview due 2027-01-20
Requirementsgitgit must be installed and available on PATH.
Version supportgit Current supported releasesVerified for linux, macos, windows using bash, zsh, powershell syntax; consult compatibility notes for platform-specific differences.
Expected signalsworktree /srv/appRepresentative successful output; values vary with the selected target and system state.
Known errorsgit: command not foundgit is missing or is not available on PATH.
Verifygit worktree list --porcelainThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01gitCommandRuns the git stage of this one-liner.
02worktreeArgumentPasses worktree to git.
03listArgumentPasses list to git.
04--porcelainOptionConfigures git with the --porcelain option.
Example input
git worktree list --porcelain
Example output
worktree /srv/app
HEAD 8f42c10a6db765a8a8d27636cc51e24e58de9012
branch refs/heads/main
worktree /srv/app-hotfix
HEAD 31b52f0d2c9a674e44aab1bb67f045078511c711
branch refs/heads/hotfix
Illustrative output — exact values vary by system and data.
Official sources