bfg-repo-cleaner

Removing big files from Git history

☆樱花仙子☆ 提交于 2021-02-13 17:26:13
问题 I've read multiple answers advising on using either filter-branch or BFG to accomplish this task, but I feel I need further advice because my situation is a bit peculiar. I have to manage two repositories, one is basically a clone of the other, and ideally, I'd want to pull the changes from the origin into the clone on a daily basis. However, the origin repo contains very big files in its history, which are above Github's size limits. So I have to remove these files, but at the same time, I

Bitbucket reduce repo size with BFG

时光怂恿深爱的人放手 提交于 2021-01-29 03:34:07
问题 My team's repo on Bitbucket was 1.34GB due to some static assets (videos, images) I've followed instructions from BFG Repo Cleaner and my repo is now 2.37GB which is over our 2GB quota and it is now read only. The commands I've run were pretty much what's on the BFG Homepage, git clone --mirror git://example.com/some-big-repo.git java -jar bfg-1.13.0.jar --strip-blobs-bigger-than 100M some-big-repo.git cd some-big-repo.git git reflog expire --expire=now --all && git gc --prune=now -

Reset all branches of a local repo to be the same as remote

会有一股神秘感。 提交于 2020-08-23 09:05:32
问题 First this is different because this is for all branches not one. (All the ones I have found only specify this for a single branch at a time) I work on a repo that has about 20-30 branches (long story bad practice I know I know) anyways I was deleting some old commits using the git bfg cleaner and after using it you need to either delete and reclone the code or reset every branch. I know how to set branches using git fetch origin git reset --hard origin/master But is there a way to reset

BFG Repo Cleaner – Alternative to Fresh Clone

懵懂的女人 提交于 2020-01-13 10:43:08
问题 I was going to ask this on the repository but SO seemed like a more fitting place to ask this. I was able to use BFG Repo Cleaner (great tool, thank you!) to reduce our .git folder size by over 1GB, which is a smashing success as far as our repository is concerned. I have not pushed my bare clone to remote yet, as I am concerned with putting forward these changes before understanding the consequences of pushing and then not re-cloning. I understand that best practice dictates that when

How to delete one folder / directory using BFG repo cleaner?

£可爱£侵袭症+ 提交于 2020-01-01 04:30:27
问题 How do I delete only one directory using BFG? The help says: delete folders with the specified names (eg '.svn', '*-tmp' - matches on folder name, not path within repo) Which seems to mean that --delete-folders "config" will match all folders named config, anywhere in the repository. 回答1: I found the answer here: remove files from specific path The author of BFG says it can't be done, unless you use a special command to dump all blobs for a given directory to a text file, and then use --strip

How to import git repositories with large files?

a 夏天 提交于 2019-12-29 01:50:10
问题 Given that GitHub doesn't allow to push files larger than 100 MB, it is not possible to git clone and push a repository with large files into GitHub enterprise. The push fails with a: remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. remote: error: File large.zip is 145.00 MB; this exceeds GitHub Enterprise's file size limit of 100.00 MB (N.B.: there is a repository importer, but this is only for github.com, and requires

Cannot push after BFG Repo-Cleaner

孤街醉人 提交于 2019-12-25 08:17:19
问题 We have a self-hosted Gitlab instance. I used BFG-Repo-Cleaner and everything went well, but when I try to push changes I get this: remote: GitLab: You are not allowed to force push code to a protected branch on this project. P.S. I'm owner of the project. Earlier I made fork of this project and I had no problems pushing changes there. 回答1: I assume you know what you are doing and you really want to force a push. GitLab disallows a forced push to the master branch by default. You can remove

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

孤人 提交于 2019-12-24 21:19:23
问题 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. What am I missing? Say the repository is repo and the folder in question is repo/unwantedFolder . I did the following steps: Removed the unwantedFolder and re-committed: $ git rm -r --cached unwantedFolder/ $ git commit -a -m 'Drops folder' $ git

Correct Usage of BFG Repo Cleaner

陌路散爱 提交于 2019-12-23 04:29:50
问题 The BFG Repo Cleaner site gives an example of using the tool as follows to clean up a repository: Clone a fresh copy of your repo. $ git clone --mirror git://example.com/some-big-repo.git Run BFG to clean up your repo. $ java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git Use git gc to strip out the unwanted dirty data $ cd some-big-repo.git $ git reflog expire --expire=now --all && git gc --prune=now --aggressive Push changes back up to the remote $git push I understand the

How clean git repository with commit which not in work tree

冷暖自知 提交于 2019-12-23 03:28:14
问题 I cleaned the Git repository (Bitbucket cloud) with bfg, but the last commit remained uncleaned (as written in the bfg documentation: By default the BFG doesn't modify the contents of your latest commit on your master (or 'HEAD') branch, even though it will clean all the commits before it.). However, I didn’t see it and wanted to run git gc in a Bitbucket. For this I did " git reset --hard HEAD " and rolled back to it then " git push --force ". But repository size increased?! Now I have this