Closed robert-elles closed 1 month ago
For others that come across this, I found out that untracked changes does include any files / folders that .gitignore might be ignoring.
To see those, run this command
git status --ignored
In my case, there was a node_modules folder among others that got automatically added with the IDE I was using to clone the repo.
Once I removed those, it worked
I have a completely clean repo and it still complains, any idea why that could be?
$ git status --ignored
On branch master
nothing to commit, working tree clean
$ git-filter-repo --path [...]
Aborting: Refusing to destructively overwrite repo history since
this does not look like a fresh clone.
(expected freshly packed repo)
Please operate on a fresh clone instead. If you want to proceed
anyway, use --force.
Worked just fine with --force
, not sure what the problem was.
Just in case anyone else was running into this problem due to __pycache__
directories somehow being created in between removing the directory and running git-filter-repo
again, you can disable the generation of those directories.
export PYTHONDONTWRITEBYTECODE=1
find . -type d -name __pycache__ -exec rm -r {} \+
git-filter-repo --path [...]
I put a pycache workaround into e672e43ba597 (filter-repo: ignore pycache untracked files for fresh clone check, 2024-08-05), which I think should fix this issue. (That commit isn't part of a release yet.). If you try again and hit the issue after updating to a version with that commit, please do report again.
Thanks @alissa-huskey for pointing out that some python versions would stick pycache files underneath the repository of interest.
Hello, running
git-filter-repo --path git-crypt --invert-paths
I get:I get this on a repo that was just cloned. Using
--force
will corrupt my repo and remove the remote repo.