Skip to content

Bug: .codegraph/.gitignore fails to prevent the .codegraph/ directory itself from being tracked by Git #492

@SunYanbox

Description

@SunYanbox

The current .codegraph/.gitignore file generated by codegraph by default looks like this:

# CodeGraph data files
# These are local to each machine and should not be committed

# Database
*.db
*.db-wal
*.db-shm

# Cache
cache/

# Logs
*.log

# Hook markers
.dirty

This configuration causes an issue: when running git status in the project root, you'll notice that the .codegraph/ directory is still being tracked by Git. The reason is that although there is a .gitignore file inside this directory, the file itself is not ignored, so the entire .codegraph/ directory remains under Git's version control.

I understand that the intent of .codegraph/.gitignore is to ignore specific file types inside the directory, but the current approach doesn't fully achieve the effect of "ignoring the entire .codegraph/ directory."

Suggestion: Would it be possible to either add .codegraph/ to the root .gitignore file, or use * inside the generated .codegraph/.gitignore to ignore all contents while explicitly excluding the .gitignore file itself? For example:

# Automatically generated by codegraph
*
!.gitignore

This would ensure that the entire .codegraph/ directory is not tracked by Git while preserving the .gitignore file itself.

Thank you for your consideration!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions