2

So I'm trying to use git filter-repo for the first time. I've installed Python 3.9. I try to run: git filter-repo --strip-blobs-bigger-than 100M

Each time it fails:

  • Git Bash: git: 'filter-repo' is not a git command.
  • Powershell: Python was not found;
  • CMD: Python was not found;

Any advice on what I'm missing please?

Daemon Painter
  • 2,517
  • 2
  • 19
  • 33
spsuk
  • 33
  • 4
  • I realised my initial problem was not putting the file in the git core. However what I'm now seeing is permissions denied to .lock files but I have no idea why – spsuk Jan 08 '21 at 11:33

1 Answers1

2

Double-check the installation process on newren/git-filter-repo/INSTALL

You must make sure first (in a regular CMD) than git-filter-repo is in your %PATH%.
If you install it through pip, for instance, it should, since the Python folder should be added to your PATH at Python3 installation.

Once that %PATH% is correct (and you see git-filter-repo in it), then git will recognize the filter-repo command.


As commented, there is now a git-filter-repo Homebrew formula, which offers an easier installation process on a Mac.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • Thank you for the response. Please see my initial comment on the post. I got it to recognise the command however it doesn't seem to change .lock files. I'm not sure why as I'm the creator of them. – spsuk Jan 09 '21 at 11:43
  • @spsuk Check if another process is using one of those lock files. Try and see if the issue persists after a reboot, when hopefully less processes are active and less likely to keep an handle on those lock files. – VonC Jan 09 '21 at 19:08
  • If working on Mac there is now also a homebrew option I noticed after fiddling with Python2/3, pip2/3, pyenv and Git for too long. Painless: https://formulae.brew.sh/formula/git-filter-repo – bammmmmmmmm Mar 31 '21 at 16:07
  • @user3271319 Thank you. I have included your comment in the answer for more visibility. – VonC Mar 31 '21 at 16:58