因此,我的存储库被一些讨厌的二进制文件污染了。有人推送了*.zip
,*.tar.gz
和*.prm
文件,这是团队的决定。团队意识到这一点后的几个星期,移动2Gb数据并不容易。因此,我尝试按照git documentation永久删除大型二进制文件,但收效甚微。
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ git gc
Enumerating objects: 858, done.
Counting objects: 100% (858/858), done.
Delta compression using up to 4 threads
Compressing objects: 100% (677/677), done.
Writing objects: 100% (858/858), done.
Total 858 (delta 429), reused 394 (delta 144)
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ git count-objects -v
count: 17
size: 7
in-pack: 995
packs: 1
size-pack: 2690503
prune-packable: 0
garbage: 0
size-garbage: 0
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ git verify-pack -v ./.git/objects/pack/pack618eeffcb8598e6028e8b4a2319b528effdc4e4e.idx | sort -k 3 -n | tail -14
5d77503744dd5b13d49942557b867ab065f45ce1 blob 181348935 181404155 2379525068
1dec47e9668515e1ed439abb2a212831ab2e7a9f blob 181351851 181406999 2004014871
19120bdfdee8a01dc0fbd8b4df5c2a01c397fd7b blob 181352265 181406395 2560929223
5a9ccf56c946d4229c7d371be249cd754a313854 blob 181354901 181409324 2185421870
c6ced972980d0cd5b2687c80e40936e670a6fe34 blob 186368066 186424765 1631157469
9812153c40c04b858973a8f5cb454ca83511168d blob 186372556 186428021 1817582234
b3b0378bf8261ea9abc8320b07ba52f8b323d9dc blob 190934090 190992178 1235050344
dc4b61aeb2ba7b8ea2308b10f353b3fb72d99db6 blob 190939722 190996494 1426042522
701220a3338f03559d36a7e08acc6d43ba44f527 blob 190970237 191028317 824686988
8315196da13232575f7fa3f5eb779486b951a687 blob 190975460 191032189 1015715305
14727037299bca96ffb03e7135624378416cdccd blob 190976540 191034639 428419015
afd73d0f05eff24d9c88f50bc423b2decb86e9b2 blob 190982500 191039306 619453654
73b51dafac70f370d647d68e570c58a2ac591315 blob 190991908 191049972 15835371
0d168d00e1399f886026cb1013072c3a47a26d8b blob 190997145 191053844 223172762
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ git rev-list --objects --all | grep '5d77503744dd5b13d49942557b867ab065f45ce1\|1dec47e9668515e1ed439abb2a212831ab2e7a9f\|19120bdfdee 8a01dc0fbd8b4df5c2a01c397fd7b\|5a9ccf56c946d4229c7d371be249cd754a313854\|c6ced972980d0cd5b2687c80e40936e670a6fe34\|9812153c40c04b85897 3a8f5cb454ca83511168d\|b3b0378bf8261ea9abc8320b07ba52f8b323d9dc\|dc4b61aeb2ba7b8ea2308b10f353b3fb72d99db6\|701220a3338f03559d36a7e08ac c6d43ba44f527\|8315196da13232575f7fa3f5eb779486b951a687\|14727037299bca96ffb03e7135624378416cdccd\|afd73d0f05eff24d9c88f50bc423b2decb8 6e9b2\|73b51dafac70f370d647d68e570c58a2ac591315\|0d168d00e1399f886026cb1013072c3a47a26d8b' | cut -d ' ' -f2 | sort | uniq
distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz
distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.zip
distribution/pyramids-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz
distribution/pyramids-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.zip
distribution/pyramids-server/pyramids-server-distribution-0.1.0-SNAPSHOT-distribution.tar.gz
distribution/pyramids-server/pyramids-server-distribution-0.1.0-SNAPSHOT-distribution.zip
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ git filter-branch --index-filter 'git rm --ignore-unmatch --cached distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 20a50c39f4ce2a1e78b2c2210443eb7f91abee1d (17/83) (15 seconds passed, remaining 58 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 472c7f15fffd6995c3ca4457cd2bb1c2d0d77995 (19/83) (18 seconds passed, remaining 60 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 77f9d526f7d9fe794377bb74091f866c58397575 (19/83) (18 seconds passed, remaining 60 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite a3be32f99b07824fd5be8460d8610bd5df87d0b1 (21/83) (20 seconds passed, remaining 59 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite ee688ff8f9d58ad9cd984276ba8f7d1563228919 (21/83) (20 seconds passed, remaining 59 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 1f33ec14c34d36314431a2f4c67ddedb9bc54057 (23/83) (24 seconds passed, remaining 62 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 666b5dfc33c96afd5597d6ed62411612017700d9 (24/83) (25 seconds passed, remaining 61 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite e6ccf6b15a4c59a34247aef5640c0f4751f4bfee (25/83) (26 seconds passed, remaining 60 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 4d750d7d08b14e5041bf6e3b2e0875db0b9f97ab (26/83) (27 seconds passed, remaining 59 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 09da9b749178b6dc96b7d3568de0c20aeff17f1f (27/83) (28 seconds passed, remaining 58 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 0089bdb6fa423bae109ead5acf9c6cd95c26de4b (28/83) (29 seconds passed, remaining 56 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 5dc1614afa8ecb94115d48aae889bf394715d86f (29/83) (30 seconds passed, remaining 55 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 5db27ac19b44a3abee5dccb903c52b41d7bab701 (30/83) (31 seconds passed, remaining 54 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 36745761a4bd99d5092652a0fc55bacf389a72a8 (31/83) (31 seconds passed, remaining 52 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite fedc1296bf8615f4d8ae35000a4091b8129de3d4 (31/83) (31 seconds passed, remaining 52 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 449d094d0e5e97b51219bc786f940167f29605e3 (33/83) (33 seconds passed, remaining 50 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 42f61c17b30fd77a9f2cf36ae94a848e1b0614ff (33/83) (33 seconds passed, remaining 50 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 9a5001911b85a689aa2f92c8b43fd3349e3c1caa (35/83) (35 seconds passed, remaining 48 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 766c3063a009b3b880e41da54120c88cebfdc063 (35/83) (35 seconds passed, remaining 48 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 0c4934601516d3a36e2b5f4239f8751d6b636284 (37/83) (37 seconds passed, remaining 46 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 379941668464d8b6961e852ebc77c0da0bd9bdfa (37/83) (37 seconds passed, remaining 46 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite d712f1a7001e239065c396b622bfdcd04676aac4 (39/83) (38 seconds passed, remaining 42 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite f06a4d5b8f52007f34d8763a645acffdb961294e (39/83) (38 seconds passed, remaining 42 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite c701fff725d94afe36957114b853204f3cefa947 (41/83) (40 seconds passed, remaining 40 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 261f463f0cc676d44e69b95473e6dea01fcc148b (41/83) (40 seconds passed, remaining 40 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite d4b688feedced9b04da527bf7a00869edab1f854 (43/83) (41 seconds passed, remaining 38 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 05513b9eb66c45c8992312a5befa637a257b5d7e (43/83) (41 seconds passed, remaining 38 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite be2dba0ac3562db273031b4658db1c3b9de23c76 (45/83) (43 seconds passed, remaining 36 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 6462aa7bdbb5d1d71ad22766f5d01076fd0331e7 (45/83) (43 seconds passed, remaining 36 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite aa7c7f27b7d038415d9b9f03cc8324f9af46c4d2 (47/83) (45 seconds passed, remaining 34 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 5fc844d7878a28c2f05823834cd8a3eb68f681ef (47/83) (45 seconds passed, remaining 34 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite b80164415db3603ef6cda31b6ef1946ee5792deb (49/83) (47 seconds passed, remaining 32 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 751eba4e99a6de3dd6e074a69c8fd25a5fdf784b (49/83) (47 seconds passed, remaining 32 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 3a8ed2778f2f8cef517152b035c3683be6f9f882 (51/83) (49 seconds passed, remaining 30 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 8f5eab1a23ed788005af9cc0df74e2903de9aaaf (51/83) (49 seconds passed, remaining 30 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite ded36318d146c0afc2afec5d9e5ada88ae2d14a8 (53/83) (51 seconds passed, remaining 28 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 06cfc22b8f32e1993063819c06427c2f68d2d319 (53/83) (51 seconds passed, remaining 28 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite e5b1171a01b70f6a13170db0d85ee34342e85ac6 (55/83) (53 seconds passed, remaining 26 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 4a8248c50f521e76054446d4ff86b44e4b05385b (55/83) (53 seconds passed, remaining 26 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite a6eceb9a435178181eddf22eee909873f0719106 (57/83) (55 seconds passed, remaining 25 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite c406a08b5b58ea41c3b8476682fcd750d3e2a5e7 (57/83) (55 seconds passed, remaining 25 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite ea3ce9bb93bddef8062df11e15c3f3181ca582c7 (59/83) (58 seconds passed, remaining 23 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 24a9b59b817d95d433afeb0a9168d1df5c53fc76 (59/83) (58 seconds passed, remaining 23 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 1f4dac5e053ee657decf3cb4d439040b60cc6f70 (61/83) (60 seconds passed, remaining 21 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 24b11986ed9da5c9d37ab9986e39f5facb908275 (61/83) (60 seconds passed, remaining 21 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 225bcee16027e0112be2531c78540ed9890a81e1 (63/83) (64 seconds passed, remaining 20 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 4eca87281c18770f819a4abe6a98327beea2965a (64/83) (65 seconds passed, remaining 19 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite a07edf253385d8067747a2b249188e2cb7432eec (65/83) (66 seconds passed, remaining 18 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 925a24db800a943f22beae16094a56132d845652 (66/83) (67 seconds passed, remaining 17 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 4ff2c39459e27578e3104f15d0b3ba3ac6504529 (67/83) (68 seconds passed, remaining 16 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite c4ab8c45920fa63f8abf4fd7d6924cedf0f9eb20 (68/83) (69 seconds passed, remaining 15 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 34d326cc2bffee357e387d6c3ede2c9568d6c9ab (69/83) (70 seconds passed, remaining 14 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 4bae7709f658eb6ca4c11dce050660bf60aa3676 (70/83) (71 seconds passed, remaining 13 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite f027481c0b1b3e6610e409093785facd3e7cc71f (71/83) (72 seconds passed, remaining 12 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 008f8e61fa6daf824f1a5f5b0eb705cef1019494 (72/83) (73 seconds passed, remaining 11 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite a659caded22232bf61d3e303106f59e7b0c7f139 (73/83) (74 seconds passed, remaining 10 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite a3e0ad7947a498fd89e72ef1b55a8bc12c7f42f1 (74/83) (75 seconds passed, remaining 9 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite fbddd04a1cacb569c34f0aa169ef6cb6e6a713ae (75/83) (76 seconds passed, remaining 8 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 9e807731a63b1f767026836d5e99e5b1d7b65e6f (76/83) (77 seconds passed, remaining 7 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite a653c59bca8cd5031c906949e7c83f440a4f1c19 (77/83) (78 seconds passed, remaining 6 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite e87bb4bedbc8384fa34b8181129f25db3294c7e2 (78/83) (79 seconds passed, remaining 5 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 9e6d2d0daa0022fb35c3ae39764b536f1fce58ed (79/83) (80 seconds passed, remaining 4 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 4172741e9064a03ad70f52a89079f39abf72ad29 (80/83) (81 seconds passed, remaining 3 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 45b0ee5177edd1bac2537133f5bdd2c62b15a423 (81/83) (82 seconds passed, remaining 2 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite 2c435678068cf451f638fa114ab2250ccc68f6d8 (82/83) (83 seconds passed, remaining 1 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Rewrite aab25553061314a84e26cb05682d6d08c8aab6eb (83/83) (84 seconds passed, remaining 0 predicted) rm 'distribution/cylinders-server/cylinders-server-distribution-0.2.0-SNAPSHOT-distribution.tar.gz'
Ref 'refs/heads/master' was rewritten
...其次是...
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ rm -Rf .git/refs/original
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ rm -Rf .git/logs/
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ git gc
Enumerating objects: 997, done.
Counting objects: 100% (997/997), done.
Delta compression using up to 4 threads
Compressing objects: 100% (528/528), done.
Writing objects: 100% (997/997), done.
Total 997 (delta 457), reused 852 (delta 429)
?️ MINGW64 /c/github/Project-Cylinder-UI-Sync-2 (master)
$ git count-objects -v
count: 97
size: 45
in-pack: 997
packs: 1
size-pack: 2690500
prune-packable: 0
garbage: 0
size-garbage: 0
如您所见,size-pack
的值从2690503
Kb更改为2690500
Kb,这并不是令人印象深刻的清理工作。但更重要的是,运行$ git rev-list --objects --all | grep 5d77503744dd5b13d49942557b867ab065f45ce1
5d77503744dd5b13d49942557b867ab065f45ce1 distribution/cylinders-server/cylinders-server-distribution-0.1.0-SNAPSHOT-distribution.tar.gz
仍显示文件有 ...