How To Remove GIT History And Make Your Repo Smaller

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2022
  • In this video I'll go over the steps you need to take to shrink down your repo and only leave the latest iteration up. One thing I didn't mention is that you should also manually check for large files that are in the latest commit that can be remove, but that is somewhat an aside and not everyone will need to do that.
    Join this channel to help support future productions:
    ▶ / @codetechandtutorials
    ▶ Patreon: / codetechtuts
    ---
    ▶ CTT Discord: / discord
    ▶ CTT Github: github.com/codetechandtutorials
    ▶ CTT Business Email: codetechtuts@gmail.com
    ▶ CTT Playlists: / codetechandtutorials
    ---
    Resources:
    ▶ / cleaning-up-a-git-repo...
    ▶ git-scm.com/docs/
    ▶ git-scm.com/docs/git-add
    ▶ git-fork.com/
    ---
    Written, Edited, & Produced By:
    Matt Early
    ---
    Matt's Other Stuff (in case you want to find me or interact or support or whatever):
    1. Matt's Github: github.com/mattearly
    2. Matt's Twitter: / matthewjayearly
    3. Matt's Instagram: / matthewjearly
    4. Matt's Twitch: / overridetheprogram
    5. Matt's Gaming TH-cam: / overridetheprogram _support:
    ☕ www.patreon.com/codetechtuts?...
    Patrons help this channel go round and keep creating. If you don't like patreon but still would like to support regularly, you can do a similar subscription via the TH-cam Join, or through Github's sponsor button.
    🕮github.com/codetechandtutorials
    This is were I most the majority of the code seen on the channel.
    ✍ / discord
    We have a Discord! We welcome all various code and tech chatter.
    ☯ / bytepro17124
    I stream code and/or gaming every Thursday! I also randomly stream a time or two throughout most weeks.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 36

  • @ValdoSouza77
    @ValdoSouza77 15 วันที่ผ่านมา

    Thank you man, this was really helpful !

  • @bentheboii9254
    @bentheboii9254 2 หลายเดือนก่อน

    Life saver man!!

  • @ujavalgandhi5794
    @ujavalgandhi5794 ปีที่แล้ว +3

    This was really helpful. The only video that showed me exactly how to do what I wanted to keep only the latest commit and delete the full history. Thanks!

  • @khaledali615
    @khaledali615 4 หลายเดือนก่อน

    that was litt thankuu

  • @Alex-rl1gl
    @Alex-rl1gl ปีที่แล้ว

    very kind of you to share this info. thanks so much

  • @LuisGustavo-dk4qy
    @LuisGustavo-dk4qy ปีที่แล้ว +1

    Thank you!

  • @edisonmondal2798
    @edisonmondal2798 8 หลายเดือนก่อน

    Sir you have no idea that this tutorial of your has saved my life ❤❤😊😊

  • @eumm11
    @eumm11 ปีที่แล้ว

    awesome mate, thank you so much!

  • @ramikmukherjee6984
    @ramikmukherjee6984 ปีที่แล้ว

    😁worked thanks

  • @RushilKumar1
    @RushilKumar1 2 ปีที่แล้ว

    Awesome video

  • @fanolinux
    @fanolinux ปีที่แล้ว

    thank you!

  • @aliahmadi3557
    @aliahmadi3557 4 หลายเดือนก่อน

    lifesaver, thank you

  • @Bmozzi
    @Bmozzi 2 ปีที่แล้ว +1

    You saved my life

  • @rudinasubaih
    @rudinasubaih ปีที่แล้ว +3

    Thank you for the video. I want to keep the last 20 commits for example. What should I do in this case?

    • @erick_falker
      @erick_falker ปีที่แล้ว

      I know it's a little bit late for the answer, but I'm gonna aswer anyway:
      #this will create an orphan branch with the content of the 20th commit from the master branch.
      git checkout --orphan='orphan_branch' 'master~20'
      #run a commit, since the orphan branch starts with no commits, just like a repo from scratch.
      git commit --message='initial commit'
      #cherry-pick the 20 latest commits from the master branch and apply it to the orphan branch:
      git cherry-pick -- 'master~20..master~0'

  • @GiviKuchukhidze
    @GiviKuchukhidze ปีที่แล้ว

    Great! 👍

  • @omarshref4803
    @omarshref4803 ปีที่แล้ว

    Love love love ❤️ 😍

  • @bulixss
    @bulixss ปีที่แล้ว +1

    i have to do the same but my problem is i cant delete all the branches because other teams are working on them, it can be donde anyway and then i could suggest to them to do a rebase or something like that?
    Thank you for the video also.

    • @pradub3541
      @pradub3541 9 วันที่ผ่านมา

      same here, he didnt mention how other people should update it. if they run git fetch its done or they have do some other stuff?

  • @thomasmcivor2665
    @thomasmcivor2665 ปีที่แล้ว

    the repo i want to clone is not mine. how do i remove all the old commits and branches and all other bs.... without changing the original repo

    • @CodeTechandTutorials
      @CodeTechandTutorials  ปีที่แล้ว +1

      Fork it first probably

    • @thomasmcivor2665
      @thomasmcivor2665 ปีที่แล้ว

      @@CodeTechandTutorials actually manged to get it done with deleting old commits and some other random stuff i cant remember. think forking is a good option but thats only if forking is allowed. soz to be rude just a bit grumpy cos i cant solve stuff atm

    • @CodeTechandTutorials
      @CodeTechandTutorials  ปีที่แล้ว

      @@thomasmcivor2665 I understand, no worries. There is also a clone with --depth 1 option to not get all the old stuff, which I didn't think of earlier.

  • @wuxianzhe6571
    @wuxianzhe6571 ปีที่แล้ว +1

    if this is the way to clear the history, why not simply create another repository with latest head?

    • @colakcode
      @colakcode 9 หลายเดือนก่อน

      That's what I thought when I first watched it. But still better than creating a new repository.

  • @xade8381
    @xade8381 2 ปีที่แล้ว +2

    if u r losing each & every commit, then simply create a new repo instead

    • @regenadaun001
      @regenadaun001 ปีที่แล้ว +1

      This cannot be *coincidental---as I've seen the word "COMMIT" under search* *_instead of the proper word_* COMMENT"!*
      I UNDERSTAND *ENGLISH* is a second language for the multitude in Society@currently+
      But *if PEOPLE would HELP in a KIND WAY*
      ~MAYBE WE CAN HELP ONE PERSON~AT A TIME√
      AND PERHAPS>>>THAT PERSON

    • @regenadaun001
      @regenadaun001 ปีที่แล้ว

      *Thanks* to whomever highlighted,~~my comment. U gave ME a HIGH, I wasn't expecting such a generous response+ ☮️ TY+

    • @regenadaun001
      @regenadaun001 ปีที่แล้ว

      I just do not understand any of this
      ( Git/stack overflow/etc)
      And very much, CANNOT BELIEVE THIS IS *_LEGAL_*

  • @thomasmcivor2665
    @thomasmcivor2665 ปีที่แล้ว

    7 minutes ffs you couldve made this a 3 minute video

  • @Andy-si1pl
    @Andy-si1pl 4 หลายเดือนก่อน

    Canyonero

  • @zupacro
    @zupacro ปีที่แล้ว +1

    Thank you man, this was really helpful !

  • @Buzca
    @Buzca ปีที่แล้ว

    thank you!