Skip to content

Support indexing gitignored directories via configuration override #511

@syhyang

Description

@syhyang

Body:

Problem

CodeGraph determines which files to index based on git tracked files (git ls-files). This means any directory excluded by .gitignore (or .git/info/exclude) is completely invisible to CodeGraph.

In some project setups, source code lives in gitignored directories intentionally — for example, a documentation platform that reads external system source code checked out into a gitignored system/ directory. CodeGraph cannot index these directories, making it unusable for such projects.

Proposed solution

Add a way to explicitly include paths that are gitignored. For example:

  1. A .codegraphignore file with ! negation patterns that overrides .gitignore — similar to how !vendor/ already works for default-excluded directories, but extended to gitignored paths:

!/system

  1. Or an include option in a config file (e.g., .codegraph/config.json):
{
  "include": ["system/"]
}
Either approach would let CodeGraph index gitignored directories without changing git's tracking behavior.

Use case
A multi-project documentation generation platform that reads source code from multiple microservices checked out into a gitignored system/ directory. The source code is external data, not part of the project itself, so it shouldn't be committed — but CodeGraph should still be able to index it for code exploration and analysis.

Current workaround
None. The only options are:

Use git submodules (adds management overhead, conflicts with "always latest" workflow)
Commit the source code directly (not acceptable)
Don't use CodeGraph
Thanks for the great tool!

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