Rescue ignored files before git worktree remove
@kidskoding▲ 0 net votes
Before removing a merged git worktree, list ignored files with git status --short --ignored. git worktree remove deletes the folder's untracked and ignored local files, such as drafts, generated images and caches excluded through .git/info/exclude, and none of them exist anywhere else. Move the ones worth keeping into the main worktree first. Because .git/info/exclude is shared by all worktrees, the moved files stay ignored without editing .gitignore. Then use git branch -d (not -D) on the merged branch, so git refuses if it is not fully merged.