It is a fact that your git repository accumulates a lot of history. Even though git was not built for binary files, people do store them in repositories and that contributes to the growth. At a certain point you might be removing binary files and looking back at the history of an image is not something that you do every day. So why not remove all the massive blobs from history? I know, it sounds like you need to rewrite the history and that is dangerous isn't it? Not quite, with a nice tool called bfg.
Right, let's start:
1. Download bfg or install it via brew, yum, etc.
2. Create a bare clone of your git repository:
git clone --mirror git://something.com/big-repo.git
3. Create a backup of the repository(just in case)
cp -r big-repo.git big-repo.git_bak
4. Run this:
bfg -b 100K big-repo.git
This will remove all files over 100K, but don't worry, HEAD is protected. There are many other options(including protecting other branches), have a look at their documentation or just run bfg with no arguments to see the options.
5. Run git gc to actually remove the files
cd big-repo.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
6. [Optional] Create a new repo where you push the changes. I like to push the changes into a new repo to be 100% sure that the repository is in a good state. Before pushing, change the url for remote "origin" inside big-repo.git/config.
7. Push the changes:
git push
8. Done. Enjoy your lean repository!
more information sh.st/nWkTN
ReplyDeletemore information sh.st/nWkTN
ReplyDeleteFuck this guy. ^^ Spammer. Don't click.
ReplyDelete
ReplyDeleteشركة تنظيف افران بالدمام
شركة مكافحة حشرات بالخبر
ReplyDeletetuetabar eamaliaat albahth ean sharikat mukafahat hasharat bialkhabar min 'akthar al'ashya' alati taqum biha taqum biha almamlakat almutahidat mae dukhul fasl alsayfi.
wamin almaeruf 'ana altaayirat almaerufat biaism altaayirat wahataa alnaml wabaq , wamusaeadatihim , wazuhurihim mae ziadat darajat alhararati.
شركة مكافحة الحمام بالخبر
sharikat mukafahat hamaam bialkhabar bialkhabar walkhabar min al'ashya' alati yabhath eanha aleumala' fi alkhabar , wadhalik min 'ajl alhusul ealaa jawazat safar wafidat min altuyur , tuafir mkanan fi mintaqat alkaram alhadithat waltaqniaat min 'ajl tilk alsuwrat waltilialiat fi tilk al'anwae min altibaei. altaaqat alati tama tarkibuha ealaa kafat alhafalat , waltaaqat , waltaaqat , waltaaqat , waltaaqat alkahrabayiyat , wakadhalik altaaqat alkahrabayiyatu.
شركة تنظيف مكيفات بالخبر
sharikat tanzif mukayifat bialkhabar taqum bikuli 'aemal altanzif ealaa 'akmaliha ladayha khibrat wakafayh ealyh fi hadha almajal , walkitabat fi jawlat fi alfaragh 'iinama bialtarkiz lilwusul 'iilaa 'aelaa darajat fi aldarajat al'uwlaa , kama tahtamu .
bisabab airtifae darajat alhararat alshadidat , fa'iina kathrat aistikhdam almukayifat wakathrat taearudiha lilkharij alkharijii yaeriduha dakhil almukayif wadukhul 'iilaa alkharij , wahadha yadulu ealaa 'ana jamie 'afrad hadhih al'aemal yaemalun fi 'aemal altanzifi. khibratan khasatan mae sharikat khibrat ealiat mithl sharika
شركة تعقيم بالخبر
taeqim bialdamaam , waltibaeat waltaeqim , waltibaeat , waltibaeat , waltibaeat , waltibaeat , waltibaeat , waltibaeat , waltibaeat , waltibaeat , waltibaeat li sharikat altaeqim waealaa rasiha sharikat taeqim bialdamaam alati tamtalik khtwtan taemal fi alkharij fi alhifaz ealaa alsihat aleamati.
شركة تسليك مجاري بالخبر
sharikat taslik majari bialqatif sharikat altatwir aleaqarii fi almustaqbal bialqatif min akhtur almashakil alati qad tuajihuk natijatan lisababih min nawe sababuh min alsabab wara' dhalik lilmanzil walilhamaamat walmatabikh alkhasat bialmanzil wamushkilat ainsidad almajari 'aw alsirf alsihiyi 'aw ainsidad
شركة تنظيف منازل بالخبر
sharikat tanzif manazil bialkhabar tastakhdim afdal turuq albaye aldaakhilii lilmanazil bialkharij bialaietimad ealaa aleamalat dhat aleamalat alkabirat fi tanfidh kafat aemaal tanzif almanazil w alkhadamat
wasaead fi alhusul ealaa mujtamae watiib , wabiyat , wabiyat , wabiyat , wataeam , wanas tawal alwaqt
شركة ركن الكرم
ReplyDeleteافضل شركة في الرياض معتمدة
افضل شركة كشف تسربات المياه بالرياض