Questions tagged [bfg-repo-cleaner]

BFG Repo-Cleaner is an alternative to Git's native filter-branch tool that's designed to perform branch filtering significantly faster.

The BFG Repo-Cleaner is an alternative to Git's native git filter-branch that's made for cleansing unwanted data (big files, passwords) out of Git repository history. It's designed to be faster and simpler to use, and is written in Scala.

The BFG Repo-Cleaner is even officially endorsed as an alternative in the official Git documentation for filter-branch itself:

git-filter-branch allows you to make complex shell-scripted rewrites of your Git history, but you probably don’t need this flexibility if you’re simply removing unwanted data like large files or passwords. For those operations you may want to consider The BFG Repo-Cleaner, a JVM-based alternative to git-filter-branch, typically at least 10-50x faster for those use-cases, and with quite different characteristics:

  • Any particular version of a file is cleaned exactly once. The BFG, unlike git-filter-branch, does not give you the opportunity to handle a file differently based on where or when it was committed within your history. This constraint gives the core performance benefit of The BFG, and is well-suited to the task of cleansing bad data - you don’t care where the bad data is, you just want it gone.

  • By default The BFG takes full advantage of multi-core machines, cleansing commit file-trees in parallel. git-filter-branch cleans commits sequentially (ie in a single-threaded manner), though it is possible to write filters that include their own parallellism, in the scripts executed against each commit.

  • The command options are much more restrictive than git-filter branch, and dedicated just to the tasks of removing unwanted data- e.g: --strip-blobs-bigger-than 1M.

See also the git-rewrite-history tag on Stack Overflow.

160 questions
0
votes
0 answers

Why is the repo size still big after using BFG but cloning size is much smaller

I have used BFG to remove a lot of big files from a repository and have reduced the "Receiving objects" when cloning to 206MB from 1.18GiB. But when I look in Bitbucket (Self hosted) and use its Approximate size feature, the old repo is 1100MB and…
Mech0z
  • 3,627
  • 6
  • 49
  • 85
0
votes
1 answer

Error: Unable to access jarfile - when running bfg.jar

I am unable to run the bfg jar command over the git repo I am trying to clean. Java version "1.8.0_201" JDK version 1.8.0_201 MacOs Sierra 10.13.3 I downloaded BFG to /usr/local/bin So total path is /usr/local/bin/bfg-1.11.6.jar If I run: java -jar…
godhar
  • 1,128
  • 1
  • 14
  • 34
0
votes
1 answer

Renaming phrase in all git repository commits (in submodules)

How can I rename a phrase for all previous commits in my git submodules? phrase1 to phrase2 My phrase is found in .pack files. (I shortened the hex .pack names): $ grep -rnw . -e 'phrase1' Binary file…
jeremy
  • 307
  • 4
  • 15
0
votes
1 answer

git push --force fail

I had recently did some clean up of my repo as it had some large files in the history. I had use BFG to clean up, did the necessary steps as mentioned here here. At the final steps when doing the git push to publish the updated changes, it fails.…
snookrun
  • 245
  • 3
  • 9
0
votes
0 answers

git filter-branch and BFG repo cleaner creating duplicate branches

I am working to move a git repo from one provider to another. As part of that process the new repo is being rejected on push due to the size of a file in the history (file was removed months ago but still exists in history). I found both git…
0
votes
1 answer

GitHub - Cleaning history of unwanted files

I'm fairly familiar with GitHub and the process of commits/push/pull/etc. but I'm not sure what's the best approach to this issue, if there is one. I have a repo for a Unity project I worked on last fall for class and there's a lot of files in that…
0
votes
2 answers

Git rewrite history, mitigating regression

I want to remove a large number of unit test files from a git repository, and wipe them from the commit history, in order to save space. I understand that two main ways of doing so is to use git filter-branch or using the BFG repo cleaner (written…
user55206
  • 1
  • 1
0
votes
0 answers

Re-wrote git history with bfg but not reflected in earlier commits

A huge folder in my repository has filled up my LFS. As instructed here, I wish to remove the folder from the remote repository and then re-write history to drop it from all previous commits. That should free up lots of space in my LFS, but is not.…
emagar
  • 985
  • 2
  • 14
  • 28
0
votes
1 answer

Git remove large files and fix pack file

A developer thought it was a great idea to place the install files of an application into the GIT repo shared by the team in TFS. So I'm trying to delete a folder in GIT repo called "Workstation Install" so all the install files are removed and then…
LordRazon
  • 91
  • 7
0
votes
1 answer

Removing files from GIT history

I have a lot of jar files in my git history, and it is taking up a lot of space. Can I use BFG Repo Cleaner to delete all jar files from my history? I think running the --delete-files command like that bfg --delete-files .jar .git,…
Gal Mor
  • 85
  • 1
  • 13
0
votes
0 answers

Git - Aggregate commits to alternate repo exceed 100MB (one file)

I have an open-sourced project that I do a considerable amount of work on and push to an internal repository, frequently. The front-end code in this project is transpiled into a single javascript file and its changes are part of every commit. (As an…
Bryce
  • 383
  • 4
  • 19
0
votes
1 answer

Removing a commit which contains sensitive information from history

I recently noticed that I had accidentally committed a .env file which contained sensitive information. My best guess is that I accidentally clicked OK when Webstorm asked me if I wanted to add the file to git because it was added to the .gitignore…
JoeWemyss
  • 607
  • 1
  • 10
  • 28
0
votes
1 answer

Do I need Garbage Collection after using BFG to rewrite git history

We committed some password into our bitbucket repository this is against our organisation security policy, so I have used the BFG Repo Cleaner to replace all the passwords with the word Removed by creating a mirror locally then bfg --replace-text…
Junchen Liu
  • 5,435
  • 10
  • 51
  • 62
0
votes
0 answers

How do I know that I've completed the last step of the BFG Repo-Cleaner successfully?

I'm following the directions from the BFG Repo-Cleaner site here... https://rtyley.github.io/bfg-repo-cleaner/ Everything seems to have run successfully, and my repo is much smaller now, but when I try to do the last step of... $ git push All I get…
twindham
  • 930
  • 9
  • 31
0
votes
2 answers

Git LFS - fatal error different files missing on 2 different machines

I was migrating my existing repository to git lfs and it seems like somehow I managed to create a perfect storm. There are currently two machines: A and B. Machine A is missing the contents of the file X. I get an error when calling git lfs fetch…
julx
  • 8,694
  • 6
  • 47
  • 86
1 2 3
10
11