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. - วิทยาศาสตร์และเทคโนโลยี
Thank you man, this was really helpful !
Life saver man!!
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!
that was litt thankuu
very kind of you to share this info. thanks so much
Glad it was helpful!
Thank you!
Sir you have no idea that this tutorial of your has saved my life ❤❤😊😊
awesome mate, thank you so much!
Glad it helped!
😁worked thanks
Awesome video
thank you!
lifesaver, thank you
You saved my life
Thank you for the video. I want to keep the last 20 commits for example. What should I do in this case?
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'
Great! 👍
Love love love ❤️ 😍
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.
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?
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
Fork it first probably
@@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
@@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.
if this is the way to clear the history, why not simply create another repository with latest head?
That's what I thought when I first watched it. But still better than creating a new repository.
if u r losing each & every commit, then simply create a new repo instead
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
*Thanks* to whomever highlighted,~~my comment. U gave ME a HIGH, I wasn't expecting such a generous response+ ☮️ TY+
I just do not understand any of this
( Git/stack overflow/etc)
And very much, CANNOT BELIEVE THIS IS *_LEGAL_*
7 minutes ffs you couldve made this a 3 minute video
Canyonero
Thank you man, this was really helpful !
thank you!