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
11k stars 547 forks source link

How to install? #255

Open Pithikos opened 6 years ago

Pithikos commented 6 years ago

Why are there still no instructions on how to install? Googling doesn't give much helpful info on how to go about it on Ubuntu.

javabrett commented 6 years ago

Is #196 any help?

DRpandaMD commented 6 years ago

++ To this. I downloaded the .jar today 12/12/2017 and it refuses to launch. I re-updated my JRE and still no bueno. MacOSX High Sierra. Shame this isn't in homebrew or something of the sort.

tflo commented 6 years ago

You also have to update/install the JDK.

BTW, bfg is in Homebrew. And IIRC when installing via Homebrew you even get a reminder to install the JDK.

– Tom

DRpandaMD commented 6 years ago

thanks :)

vernondcole commented 5 years ago

A big Me Too on this subject. I have a mac, so finding out about homebrew here was great, but that info should have been easy to find, along with instructions how to install on my Ubuntu and Windows machines.

johnnyutahh commented 4 years ago

My experience bfg is a wonderful application. It's fast and does what it says. Great stuff.

On macOS, the homebrew install makes a clean, simple, /usr/local/bin/bfg command. Simple.

On Linux we have to... download (or even worse: build?) a .jar file? I've not had to do that for about a decade. Is it hard to make a Linux rpm or deb (preferably both) to enable a simple bfg command (on Linux)?

All in all - it's a relatively easy problem to solve as a user. I'm just trying to make it easier on my config control and our team's sysadmin (docs, team training, and execuation).

Thank you again for making a great tool!

johnnyutahh commented 4 years ago

Update: bfg install via Homebrew-on-Linux appears to work, automating all the java (and related) pkg installs and resulting in a bfg command--all just like on macOS. I ran these instructions (which feels quite a bit slower in my Ubuntu kvm virtual machine that on my MacBook Pro, even though the Ubuntu kvm VM has some decent specs: $80/mo on DigitalOcean) to install Homebrew on Ubuntu 18.04.4, and then I ran:

brew install bfg

bfg appears to work fine per some minimal testing I performed, in its usual snappy-performance self. My Homebrew install directory took up ~1.2GB of storage space.

030 commented 4 years ago

For linux one could use ansible to install the bfg https://galaxy.ansible.com/030/ansible-bfg. If a deb has to be created as well, please let me know. Then I could create a PR in rtyley/bfg-repo-cleaner

druvinskiy commented 4 years ago

Hello, I am trying to install bfg, and I keep getting a command not found error. Any help would be appreciated.

030 commented 4 years ago

@druvinskiy Did you configure the alias?

In all these examples bfg is an alias for java -jar bfg.jar

firasm commented 4 years ago

I notice that there are a couple of open PRs adding some installation instructions to this repo. Is there any interest in reviving them ? Do the project devs have a different idea of where to put the installation instructions?

Let me know if another (?) PR is welcome on this issue

yiqiangjizhang commented 3 years ago

Hello, I am trying to install bfg, and I keep getting a command not found error. Any help would be appreciated.

I tried installing bfg, I have Java version 1.8 but whenever I click on the installed file it does not open anything.

yellowtailfan commented 3 years ago

How to install BFG-Repo-Cleaner on Ubuntu 18.04:

  1. Install Java:
    sudo apt-get update
    sudo apt-get install default-jre
  2. Download BFG JAR from BFG homepage
  3. Run jar
    java -jar bfg-1.14.0.jar

To use the command bfg as in the README, you can make an alias:

alias bfg=java -jar <full path to BFG jar>
ElectricRCAircraftGuy commented 1 year ago

Great instructions, @yellowtailfan! They helped me a lot.

Here are some alternate instructions for anyone who has Java already installed:

bfg installation instructions on Ubuntu

Tested on Ubuntu 20.04.

Go here: https://rtyley.github.io/bfg-repo-cleaner/ --> right-click on the "Download" button on the right --> "Copy Link Address" --> paste and use that address below. Ex: https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar

# download it
wget https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar
# mark it as executable
chmod +x bfg-1.14.0.jar

# copy or symlink it to ~/bin

mkdir -p ~/bin

cp -i bfg-1.14.0.jar ~/bin/bfg          # copy
ln -si "$PWD/bfg-1.14.0.jar" ~/bin/bfg  # symlink [my preference]

# add ~/bin to your path by re-sourcing your `~/.profile` file.
# This works on Ubuntu if you are using the default ~/.profile file, which can also be found in 
# /etc/skel/.profile, by the way.
. ~/.profile

# Now run it
bfg             # help menu
bfg --version   # version
ElectricRCAircraftGuy commented 1 year ago

Update 1: even though it installed just fine, the tool doesn't work for me, unfortunately. :(

See: https://github.com/rtyley/bfg-repo-cleaner/issues/361#issuecomment-1500539644

Update 2: use git filter-repo instead!

See:

  1. https://github.com/newren/git-filter-repo
  2. https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository
  3. Even the official git project recommends it: https://git-scm.com/docs/git-filter-branch#_warning
  4. Here is how git filter-repo is better than bfg: https://github.com/newren/git-filter-repo#bfg-repo-cleaner

How to install git filter-repo on Linux Ubuntu:

# --------------------
# 1. Download it
# --------------------

# Option 1 [easiest]: download the latest version
wget https://raw.githubusercontent.com/newren/git-filter-repo/main/git-filter-repo

# OR Option 2: get the latest *released* version.
# Go here and find the latest release:
# https://github.com/newren/git-filter-repo/releases
# Use that release number in the cmds below.
wget https://github.com/newren/git-filter-repo/releases/download/v2.38.0/git-filter-repo-2.38.0.tar.xz
# install dependencies
sudo apt install xz-utils  
# extract the downloaded archive
tar -xf git-filter-repo-2.38.0.tar.xz
# copy out the executable; we'll move it to a directory within our PATH later
cp git-filter-repo-2.38.0/git-filter-repo .

# --------------------
# 2. make it executable
# --------------------
chmod +x git-filter-repo

# --------------------
# 3. move it to a dir in your PATH
# --------------------

# Option 1 [easiest]: make this executable accessible to ALL users
sudo mv -i git-filter-repo /usr/local/bin

# OR Option 2: make this executable accessible to your user only
mkdir -p ~/bin
mv -i git-filter-repo ~/bin 
# add ~/bin to your path by re-sourcing your `~/.profile` file.
# This works on Ubuntu if you are using the default ~/.profile file, which can
# also be found in /etc/skel/.profile, by the way.
. ~/.profile

# --------------------
# 4. Done. Now run it.
# --------------------
git filter-repo --version       # check the version
git filter-repo -h              # help menu
git filter-repo -h | less -RFX  # help menu, viewed in the `less` viewer