rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
11.04k stars 545 forks source link

fatal: this operation must be run in a work tree #433

Open cmcknight opened 3 years ago

cmcknight commented 3 years ago

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
  2. Ran the bfg:

    java -jar bfg --delete-folders files --no-blob-protection myrepo.git
  3. 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.

rschristian commented 3 years ago

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.

cmcknight commented 3 years ago

I copied the git command from the website instructiions:

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

felciano commented 3 years ago

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

nafeger commented 2 years ago

I'm getting this too.