How To Remove Files And Folders From Git Using BFG Repo-Cleaner - Orbisius

1y ago
7 Views
1 Downloads
912.04 KB
5 Pages
Last View : 19d ago
Last Download : 3m ago
Upload by : Maxton Kershaw
Transcription

How to Remove Files and Folders from Git using BFG Repo-Cleaner -using-bfg-repo-cleaner-p4553 Disclaimer: This article is for educational purposes only. Make backups, think & plan! You will lose data if you're not careful. I am not responsible for your actions. Follow these steps at your own risk. I am not the author of the tool featured in this article so if you find a bug submit a ticket at the tool's repo.

Sooner or later you'll commit something to your git repo that shouldn't be there. For example ssh keys, passwords, or other sensitive data (e.g. your ex's photos). Now, you want the data gone for good. Your options are: 1. Create a brand new git repo and delete all copies of the old one and clone all fresh 2. Use BFG Repo-Cleaner 3. Use Git filter-branch (I haven't used this approach) If you have a large team and servers that already use a specific repository it maybe time consuming to change it on every single machine but it's still an option. In this article we'll be using BFG Repo-Cleaner. Keep in mind as of the time of the writing you can delete files or folders that match a regular expression. That is to say that unfortunately, you can't delete a specific folder or file. e.g. /data/my pics/ If you try it you'll get this error: BFG aborting: No refs to update - no dirty commits found? See issue #12 12 In my case I had named the files and folders descriptively so that helped me a lot. It guess people mostly use BFG Repo-Cleaner to remove videos and other large files from the repo that have a certain extension. Prep work You need to have java (or JRE) installed. So running java -version should produce some output like this: java version "1.8.0 201" Java(TM) SE Runtime Environment (build 1.8.0 201-b09) Java HotSpot(TM) Client VM (build 25.201-b09, mixed mode) Clone the repo. We need to clone the repo using --mirror option. Don't just run the bfg commands within the currently cloned folder. git clone --mirror git://example.com/some-big-repo.git Orbisius - Custom WordPress Plugins Development & Premium WordPress Plugins

Download the latest version of bfg from https://rtyley.github.io/bfg-repo-cleaner/ or if you're feeling adventurous you can download the master branch: /master.zip Here are the steps how to remove sensitive files from git How to remove folders remove the files from git and push. java -jar bfg-1.13.0.jar --delete-folders "some stupid folder name" some-big-repo.git How to remove files java -jar bfg-1.13.0.jar --delete-files my stupid file.php some-big-repo.git Do some clean up cd some-big-repo.git git reflog expire --expire now --all git gc --prune now --aggressive Inspect repo. That's at least most tutorials suggest. Push this to the world. git push As a result you'll still see your commits but they will be empty. Next, clone the repo and branches again What are all bfg options? bfg 1.13.0 Usage: bfg [options] [ repo ] -b, --strip-blobs-bigger-than size strip blobs bigger than X (eg '128K', '1M', etc) -B, --strip-biggest-blobs NUM strip the top NUM biggest blobs -bi, --strip-blobs-with-ids blob-ids-file strip blobs with the specified Git object ids -D, --delete-files glob Orbisius - Custom WordPress Plugins Development & Premium WordPress Plugins

delete files with the specified names (eg '*.class', '*.{txt,log}' - matches on file name, not path within repo) --delete-folders glob delete folders with the specified names (eg '.svn', '*tmp' - matches on folder name, not path within repo) --convert-to-git-lfs value extract files with the specified names (eg '*.zip' or '*.mp4') into Git LFS -rt, --replace-text expressions-file filter content of files, replacing matched text. Match expressions should be listed in the file, one expression per line - by default, each expression is treated as a literal, but 'regex:' & 'glob:' prefixes are supported, with ' ' to specify a replacement string other than the default of '***REMOVED***'. -fi, --filter-content-including glob do file-content filtering on files that match the specified expression (eg '*.{txt,properties}') -fe, --filter-content-excluding glob don't do file-content filtering on files that match the specified expression (eg '*.{xml,pdf}') -fs, --filter-content-size-threshold size only do file-content filtering on files smaller than size (default is 1048576 bytes) -p, --protect-blobs-from refs protect blobs that appear in the most recent versions of the specified refs (default is 'HEAD') --no-blob-protection allow the BFG to modify even your *latest* commit. Not recommended: you should have already ensured your latest commit is clean. --private treat this repo-rewrite as removing private data (for example: omit old commit ids from commit messages) --massive-non-file-objects-sized-up-to size increase memory usage to handle over-size Commits, Tags, and Trees that are up to X in size (eg '10M') repo file path for Git repository to clean Related ompletely-remove-file-gitrepository ing-nested-folders-with-bfgrepo-cleaner it-repo Orbisius - Custom WordPress Plugins Development & Premium WordPress Plugins

-permanently-delete-a-filestored-in-git Referral Note: When you purchase through an referral link (if any) on this page, we may earn a commission. Orbisius - Custom WordPress Plugins Development & Premium WordPress Plugins

What are all bfg options? bfg 1.13.0 Usage: bfg [options] [ repo ]-b, --strip-blobs-bigger-than size strip blobs bigger than X (eg '128K', '1M', etc)-B, --strip-biggest-blobs NUM strip the top NUM biggest blobs-bi, --strip-blobs-with-ids blob-ids-file strip blobs with the specified Git object ids-D, --delete-files glob

Related Documents:

AUTOMATIC TRANSAXLE – ON–VEHICLE REPAIR AX1–13. 7. REMOVE OIL TUBES Pry up the both tube ends with a large screwdriver and remove the four tubes. 8. REMOVE MANUAL DETENT SPRING 9. REMOVE MANUAL VALVE AND MANUAL VALVE BODY 11. REMOVE THROTTLE CABLE (a) Disconnect the throttle cable. (b) Remove the valve body. 12. REMOVE SECOND BRAKE APPLY .

Remove any remaining hot dogs and buns. . Allow to cool and drain the water through the drain pipe. 4. Remove the inside components of the steamer. It is easiest if the suggested order is followed: a. Remove the divider. b. Remove the wire bun rack. c. Remove the top hot dog shelf. d. Remove the bottom hot dog shelf. e. Remove the bun shelf. f.

2. Remove side covers. (R.L) 3. Remove sparkplug cap. 4. Remove the footrest from the frame. 5. Remove exhaust pipe assembly. C. Carburetor 1. Remove the ignition coil and coil bracket. 2. Disconnect the magneto lead wire. 3. Remove the rear fender. 4. Remove the rear brake cable from shaft drive housing.

District Office Administration Marketing files Service Delivery files VR policy and partnerships Fiscal and Administrative Services Team Fiscal files Contract files Vendor files Case Procurement files Social security/Ticket to Work files Social Security Unit – General Administrative

WebEx Recording Format (WRF) files Video files, including files that play in Windows Media Player and Apple QuickTime Player Audio files, including files that play in Windows Media Player Flash movie and interactive Flash files Web pages When you play the media files

work/products (Beading, Candles, Carving, Food Products, Soap, Weaving, etc.) ⃝I understand that if my work contains Indigenous visual representation that it is a reflection of the Indigenous culture of my native region. ⃝To the best of my knowledge, my work/products fall within Craft Council standards and expectations with respect to

Searching for deleted files over the entire drive is a very fast process. Recover My Files reads the file index for all files on the drive in less than 1 minute. Run a "Recover Files" search "Deleted Files (Recommended)" and then look in the "Deleted" view to see only deleted files, or switch to "Folder" .

January monthly files – March 15th February monthly files – April 15th March monthly files – May 15th April monthly files – June 15th May monthly files – July 15th June monthly files – August 15th July monthly files – September 15