Skip to content

Instantly share code, notes, and snippets.

@dennislo
Last active April 12, 2026 17:08
Show Gist options
  • Select an option

  • Save dennislo/0416054f2a2665117e697a2989811fec to your computer and use it in GitHub Desktop.

Select an option

Save dennislo/0416054f2a2665117e697a2989811fec to your computer and use it in GitHub Desktop.
Git Worktrees

Git Worktree Troubleshooting

Issue

git is reading a bad worktree path from .git/config:

  • core.worktree points at /private/var/folders/.../agents-claude-sync-g123
  • that is not your current checkout at /Users/dlo/work/dennislo.github.io

So Git thinks the repo’s working tree is somewhere else, and checkout fails.

Solution

Fix it with:

git config --local --unset core.worktree
# or, if you want it explicit:
git config --local core.worktree /Users/dlo/work/dennislo.github.io

Then retry:

git checkout develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment