Sensitiva notitia vel nimis memoriae consumptio: Sunt bonae rationes Git historiam mutare velle. In hoc blog post , explicavi quomodo lima ex Git historia utens BFG purgare. Infirmus punctum BFG defectus subsidii ad semitas directas est, ideo limas vel folder in subfolders ab historia specialiter removere non potes. Cum hoc tempore solutiones alterius spectare.
Praeter ramum sparguntur publice non commendatae sunt, repo-git-filter-repo unum instrumenta ad historiam repurgandam. Post brevem institutionem primum repositorium resolvere et invenimus, exempli gratia, maximum folder in historia:
git filter-repo --analyze
Bene in folder .git/filter-repo/analysis
generatae omnibus TXT files:
directories-all-sizes.txt
extensions-all-sizes.txt
path-all-sizes.txt
- ...
Est tabella pretium directories-all-sizes.txt
propius vultus accipies:
=== All directories by reverse size ===
Format: unpacked size, packed size, date deleted, directory name
4624417043 3796607988 <present> <toplevel>
4475940396 3778033787 <present> wp-content
4060236681 3694449320 <present> wp-content/uploads
305163809 70576241 <present> wp-content/plugins
123818107 15442735 <present> wp-includes
...
Saepe evenit ut diu neglecta ac remota a capitis notitia in historia (exempli gratia, folder instrumentorum WordPress. wp-content/uploads/
aut accidens pushed unum node_modules
- or * vendor
-Plautus).
Generaliter suadet git-filter-repo
curatis, promptu ad novum, inanis repositorium. Plures rationes hic recensentur, quare hoc sensum facit et multas difficultates vitat. Fieri tamen potest ut ad idem repositorium impellere velis, quod etiam paucis indiciis fieri potest.
Adipiscing, maior code suggestus obnoxius GitHub et GitLab diversos commendant aditus, quorum quidam inter se differunt. For example, on GitHub removemus wp-content/uploads/
per hoc gradus git-filter-repo
ex historia:
mkdir tmp-repo
cd tmp-repo
git clone git@github.com:foo/bar.git .
cp .git/config /tmp/config-backup
git filter-repo --invert-paths --path wp-content/uploads/
# option 1: same repo
mv /tmp/config-backup .git/config
git push origin --force --all
# option 2: new repo
git remote add origin git@github.com:foo/bar-new.git
git push origin --force --all
cd ..
rm -rf tmp-repo
Nunc etiam magnitudinem remotum cohibere possumus (mutata magnitudine per API et in UI usque ad 24 horas). Hoc ut facias, repositorium aperies (si repositio ad organizationem pertinet, prius rationem tuam instituendi addere debes). Nunc videmus magnitudinem:


Ratio inmutato in GitLab:
mkdir tmp-repo
cd tmp-repo
# option 1: same repo
# Settings > General > Advanced > Export project > download tar.gz file into tmp-repo
tar xzf 20*.tar.gz
git clone --bare --mirror project.bundle
cd project.git
git filter-repo --invert-paths --path wp-content/uploads/
cp ./filter-repo/commit-map /tmp/commit-map-1
# copying the commit-map has to be done after every single command from git filter-repo
# you need the commit-map files later
git remote remove origin
git remote add origin git@gitlab.com:foo/bar.git
# Settings > Repository > Protected branches/Protected branches >
# enable "Allowed to force push to main/master"
git push origin --force 'refs/heads/*'
git push origin --force 'refs/tags/*'
git push origin --force 'refs/replace/*'
# Settings > Repository > Protected branches/Protected branches >
# disable "Allowed to force push to main/master"
date
# wait 30 minutes (😱)
date
# Settings > Repository > upload /tmp/commit-map-X
# option 2: new repo
git clone git@gitlab.com:foo/bar.git .
git filter-repo --invert-paths --path wp-content/uploads/
git remote add origin git@gitlab.com:foo/bar-new.git
# Settings > Repository > Protected branches/Protected branches >
# enable "Allowed to force push to main/master"
git push origin --force --all
# Settings > Repository > Protected branches/Protected branches >
# disable "Allowed to force push to main/master"
cd ..
rm -rf tmp-repo
Post aliam moram ~ V minuta possumus ire sub Settings > Usage Quotas
view repono spatium:


Post amotionem interest omnes tincidunt implicatos in ultimis gradibus implicatos esse: Si usor nunc exercet impulsum normalem cum suo exemplari locali, hoc evenit in magnis fasciculis migrantibus ad repositio centralis. Ideo sequentia 3 optiones commendantur:
- "clone nova pauperis"
rm -rf .git && git clone xxx temp && mv temp/.git ./.git && rm -rf temp
- Nam mutata files (fretus application):
git checkout -- .
aut.git add -A . && git commit -m "Push obscure file changes." && git push
- "satus a scabere"
rm -rf repo && git clone xxx .
- "Deformis viverra cum rebase"
git pull -r
- Hic habes historiam immundae, sed in pluribus non amplius accidens repositorium remotum cum variantibus magnis localibus rescribe.
In cursu quotas hodiernae (praesertim propter novas restrictiones GitLab ), semper valet in repositoria historiarum magnitudine reprimendo easque, si opus fuerit, purgare.:
GitHub Free | GitLab Free | |
Max lima amplitudo modus | 100MB | ∞ |
Max repo magnitudine modus | 5,000MB | ∞ |
Max repo comitem modum | ∞ | ∞ |
Max altiore magnitudine modus | ∞ | 5,000MB |
Denique etiam dignum est ut ad aspectum sui hospitii, gratis variantis simile Gitea iactare. Cum magno labore potes in valde gracili server Git exempli gratia in auto-hosted (GUI per * SSL parta, Tergum includi, potestatem potens API) hospes, quae etiam praeclara sunt configurare et etiam quantum ad praesidium notitia superior. Hic obiter etiam uti potes git-filter-repo
Tantum streamline repositoria:
mkdir tmp-repo
cd tmp-repo
git clone git@git.tld.com:foo/bar.git .
cp .git/config /tmp/config-backup
git filter-repo --invert-paths --path wp-content/uploads/
# option 1: same repo
mv /tmp/config-backup .git/config
git push origin --mirror
# login on the remote command line and run in the repo-folder
sudo -u git git reflog expire --expire=now --all
sudo -u git git gc --aggressive --prune=now
# if you face memory limit issues, modify the git configuration
sudo -u git git config --global pack.windowMemory "100m"
sudo -u git git config --global pack.packSizeLimit "100m"
sudo -u git git config --global pack.threads "1"
# if in web ui the size does not change, make a slight
# modification to a file and push again normally
# option 2: new repo
git remote add origin git@git.tld.com:foo/bar-new.git
git push origin --force --all
cd ..
rm -rf tmp-repo
Hic specialiter est mandatum sudo -u git git gc --aggressive --prune=now
momenti (in cron currit git gc
aliter habet unum nimis longum putabis tempus of 2 weeks).