Description
I was trying to clean up something that accidentally got committed to a local repo. I used git clone --mirror --no-local
to make a clean copy, cd
'd into it, and tried running git-filter-repo --sdr --replace-text ../replace-text.txt
, and got this:
Aborting: Refusing to destructively overwrite repo history since
this does not look like a fresh clone.
(has stashed changes)
Note: when cloning local repositories, you need to pass
--no-local to git clone to avoid this issue.
Please operate on a fresh clone instead. If you want to proceed
anyway, use --force.
even though it is a fresh clone. The original repo does have some stashes in it. They don't seem to fully exist in the mirror - there's no (EDIT: see #652 (comment)) or refs/stash
logs/refs/stash
- but some of the underlying commits did get copied over.
How does git-filter-repo
know about the stashes, and what should I do about this error? According to the "DESCRIPTION" section of the manual, it's supposed to be able to rewrite stashes by default, but I don't see any specifics on how to go about that safely. --force
seems like the wrong option, since the stash
ref isn't there…?
(Apologies if I missed any obvious documentation about this anywhere.)