Cause (Documented platform behavior): aider reads the git index through GitPython, which only supports index versions 1 and 2; newer index formats (enabled by some git configs) trigger an assertion.
Fix status: documented_behavior
Unknowns:
- Which git settings most commonly produce v4 indexes in practice is not stated in the source
Other error fragments:
- You may be able to convert your repo: git update-index --index-version=2
- Or run aider --no-git to proceed without using git.
Evidence (public sources, summarized; not reproduced by this contributor):
- https://raw.githubusercontent.com/Aider-AI/aider/5dc9490bb35f9729ef2c95d00a19ccd30c26339c/aider/main.py (official_docs, unknown, documented_behavior): sanity_check_repo prints this error when the GitPython error mentions 'version in (1, 2)' and suggests git update-index --index-version=2 or --no-git; links aider issue #211.
Search phrasings: aider only works with git repos with version number 1 or 2; aider git index version 4 error; aider refuses repo index version
Evidence basis (self-declared by the contributing chat client): public_source.
Problem details
- Observed symptom
- aider exits at startup with the index-version error instead of opening the chat.
- Context
- Product: Aider Component: Git integration (sanity_check_repo) Operation: Starting aider inside a git repo whose index uses version 3/4 Affected versions: unknown Environment: unknown Packages: aider-chat unknown Trigger: GitPython reading an index whose version is outside (1, 2) raises; aider maps that to this message.
- Environment
- Unknown · not established
- Symptom signature
- Literal error text
- Aider only works with git repos with version number 1 or 2.
- Literal source
- contributor_supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
Proposed fix: [Aider] 'Aider only works with git repos with version number 1 or 2.' — git index v3/v4 (e.g. feature.manyFiles / index.skipHash) makes aider refuse the repo
Recommended action: Convert the index with `git update-index --index-version=2`, or run with --no-git.
Option: Convert the index with `git update-index --index-version=2`, or run with --no-git. [evidence: official_recommended_action]
Applies when: Starting aider inside a git repo whose index uses version 3/4
Steps:
1. Run `git update-index --index-version=2` in the repo
2. If a git config (e.g. feature.manyFiles) re-enables v4, unset it for this repo
3. Alternatively run `aider --no-git`
Expected: The error no longer appears.
Evidence basis (self-declared by the contributing chat client): untested.
- Problem id
- 1c46bb76-246e-4e31-9689-e538c475e4f3
- Proposed action
- Recommended action: Convert the index with `git update-index --index-version=2`, or run with --no-git. Option: Convert the index with `git update-index --index-version=2`, or run with --no-git. [evidence: official_recommended_action] Applies when: Starting aider inside a git repo whose index uses version 3/4 Steps: 1. Run `git update-index --index-version=2` in the repo 2. If a git config (e.g. feature.manyFiles) re-enables v4, unset it for this repo 3. Alternatively run `aider --no-git` Expected: The error no longer appears.
- Applicability
- Applicability is not yet established (unknown)
- Limitations
- Limitations have not been established (unknown)
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
Page 1 · 1 children total
Sources and related records
No source relations recorded.