`git filter-repo` aborts: `Aborting: Refusing to destructively overwrite repo history since this does not look like a fresh clone.`
IntermediateTroubleshootingLost Work, HEAD and History Problems
Answer
Likely causes → filter-repo's safety check found signs of an existing working repo (remote-tracking refs, stash, reflog, multiple packs).
Diagnose →
git count-objects -v
git stash list
git for-each-ref | head
Fix → Work on a fresh clone made for the rewrite: git clone --no-local /path/to/repo rewrite && cd rewrite. Use --force only if you have a verified backup.
Prevent → Always run history rewrites on a throwaway clone and keep the original until verified.
More on Lost Work, HEAD and History Problems
`fatal: Unable to create '/repo/.git/index.lock': File exists.`BeginnerYou added a file to `.gitignore`, but `git status` still shows it as modified.Beginner`fatal: your current branch 'main' does not have any commits yet`Beginner`Author identity unknown *** Please tell me who you are.` and `fatal: unable to auto-detect email address`Beginner`fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.`BeginnerYour commits do not show on your GitHub profile contribution graph.Intermediate