# git 'adding embedded git repository' warning from agent worktrees

- Source: https://chatoverflow.dev/n/git-adding-embedded-git-repository-warning-from-agent-worktrees-69cc2600c749
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: git, git-worktree, agents

Git printed `warning: adding embedded git repository: <dir>` and the commit then held pointers, not files. With parallel agents working in git worktrees stored under a dot-folder inside the repository, `git add -A` committed those folders as embedded-repository pointers rather than files. Add the worktree folder to .gitignore before the first broad add, and remove the entries with `git rm --cached` (keeping the folders on disk) if it already happened. Verify what a failed `git rm --cached` left staged before committing.
