bfg-repo-cleaner icon indicating copy to clipboard operation
bfg-repo-cleaner copied to clipboard

fatal: this operation must be run in a work tree

Open cmcknight opened this issue 3 years ago • 4 comments

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:

  1. Cloned the repo:
git clone --mirror https://github.com/myname/myrepo.git
  1. Ran the bfg:
java -jar bfg --delete-folders files --no-blob-protection myrepo.git
  1. Changed to the directory:
cd myrepo.git
  1. Received error message:
fatal: this operation must be run in a work tree

All other operations result in the same error message.

cmcknight avatar Apr 08 '21 15:04 cmcknight

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.

rschristian avatar Apr 09 '21 00:04 rschristian

I copied the git command from the website instructiions:

git clone --mirror git://example.com/some-big-repo.git

cmcknight avatar Apr 13 '21 15:04 cmcknight

@cmcknight did you get this resolved? I'm running into the same issue

felciano avatar Apr 25 '21 20:04 felciano

I'm getting this too.

nafeger avatar Sep 07 '22 16:09 nafeger