chore: gitignore .claude/worktrees/ - #12
Merged
Merged
Conversation
…ain as gitlinks .claude/worktrees/<name> (created by the Claude Code EnterWorktree tool) was not excluded, so a git add -A in the main checkout twice added these nested checkouts as gitlink entries (mode 160000) on local main, plus once dragged in an unrelated stray AGENTS.md. Neither commit was ever pushed; both were reset away. Ignoring the directory outright stops it recurring. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
起因
.claude/worktrees/<name>(Claude CodeEnterWorktree工具的每任务 worktree)此前没有被.gitignore排除。这类目录本身也是独立的 git 仓库,主仓库里对它执行git add -A之类的操作会把它当作 gitlink(mode 160000)提交进去——本地 main 分支上已经因此出现过两次意外提交(一次还夹带了一个从未同步过的AGENTS.md),均在推送前发现并丢弃。改动
.gitignore新增.claude/worktrees/,与已有的.worktrees/(ADR 0009,项目自带的按任务 worktree)区分开、并列排除。验证
pre-commit(doc-guard / regen-adr-index / audit-tags)通过(无匹配文件,全部 skip,符合预期——纯.gitignore改动)。🤖 Generated with Claude Code