`fatal: 'main' is already checked out at '/home/dev/app-hotfix'`
IntermediateTroubleshootingLost Work, HEAD and History Problems
Answer
Likely causes → Git forbids the same branch being checked out in two worktrees at once.
Diagnose → git worktree list.
Fix → Use a different branch in the second worktree (git worktree add -b hotfix ../app-hotfix origin/main), or remove the other worktree (git worktree remove ../app-hotfix). Stale entries: git worktree prune. As a last resort, --force, but understand the risk.
Prevent → Create a new branch per worktree, and remove worktrees when done.
More on Lost Work, HEAD and History Problems
`fatal: Unable to create '/repo/.git/index.lock': File exists.`BeginnerYou added a file to `.gitignore`, but `git status` still shows it as modified.Beginner`fatal: your current branch 'main' does not have any commits yet`Beginner`Author identity unknown *** Please tell me who you are.` and `fatal: unable to auto-detect email address`Beginner`fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.`BeginnerYour commits do not show on your GitHub profile contribution graph.Intermediate