bfg-repo-cleaner
bfg-repo-cleaner copied to clipboard
fatal: this operation must be run in a work tree
MacOS 11.2.3 (Big Sur) Git: 2.31.1 BFG: 1.41.0
Attempting to remove a folder of files from the repo that are stored on LFS.
Steps to reproduce:
- Cloned the repo:
git clone --mirror https://github.com/myname/myrepo.git
- Ran the bfg:
java -jar bfg --delete-folders files --no-blob-protection myrepo.git
- Changed to the directory:
cd myrepo.git
- Received error message:
fatal: this operation must be run in a work tree
All other operations result in the same error message.
When you clone with --mirror
you don't get a working tree. You've left out what git command you tried to use, but whatever it was, it's an invalid one when working in a repo cloned with --mirror
.
I copied the git command from the website instructiions:
git clone --mirror git://example.com/some-big-repo.git
@cmcknight did you get this resolved? I'm running into the same issue
I'm getting this too.