5

I am trying to use BFG Repo Cleaner to replace some text in one of my git repos.

I have downloaded and installed the jar file, but when I try to run the bfg command I get error "bfg: command not found".

When I run the bfg.jar file it seems to work fine, but if I try to use the command to run the bfg.jar file and the bfg command I am trying to execute, I get error "Unable to access jarfile bfg.jar".

I have copied the bfg.jar file location and name directly to avoid typos. I have tried in git-bash and in powershell and get the same error.

Here is the commands I have tried in both powershell and git-bash, as well as the responses I am getting:

$ java -jar /c/workspace/bfg-1.13.0.jar
bfg 1.13.0
Usage: bfg [options] [<repo>]

$  bfg --replace-text private.txt  repo-name.git
bash: bfg: command not found

$  bfg --rt --replace-text private.txt  repo-name.git
bash: bfg: command not found

$ java -jar /c/workspace/bfg-1.13.0.jar --replace-text private.txt  repo-name.git
Error: Unable to access jarfile bfg-1.13.0.jar

Can anyone see what I am doing wrong here? I wasn't able to find anything with this same issue so I know it's user error but I cannot find my issue.

Thanks for the help!

Heather Frank
  • 135
  • 3
  • 8
  • 1
    Welcome to SO! What is the result if you change to the c/workspace directory first, and then try `java -jar ./bfg-1.13.0.jar`? – Brandon McClure Jan 24 '19 at 14:41
  • bfg 1.13.0 Usage: bfg [options] [] – Heather Frank Jan 24 '19 at 22:04
  • That helped! Now when I run the command java -jar ./bfg-1.13.0.jar --replace-text C:/Users/Owner/Desktop/private.txt C:/Workspace/code/repo-name.git from the folder holding the jar file I am just getting C:\Workspace\code\repo-name.git is not a valid Git repository. So. Progress. I'm going to look to see if I am entering the git info incorrectly and such. Thanks! – Heather Frank Jan 24 '19 at 22:14

1 Answers1

5

The answer was to run the commands from the location of the bfg.jar and enter the full path of the git mirror. Thank you brandon!

Heather Frank
  • 135
  • 3
  • 8