How to squash and rebase in git
Vložit
- čas přidán 10. 09. 2021
- Git rebase is a handy tool to have for creating nice clean history in your git repository. Come on in to see how it works and how it can help you clean up your commit history.
Level Up
Data Structures & Algorithms
www.udemy.com/course/the-swif...
Level Up AutoLayout
www.udemy.com/course/level-up...
Level Up in Swift
www.udemy.com/course/level-up...
Twitter
@jrasmusson - Věda a technologie
Thank you!!! A lot of people say ":wq", but they didn't mention press "esc" before that !!!! That's why I found your video!
Save my day!
ngl, the only video that actually helped me understand squash, and taught me how to use it
Happy to see howard from better call saul is doing good and switched careers to software engineering .
Very nice tutorial! 🎉
Superb, in a short video, I learned a lot ;)
Awesome video man! Definitely going to start using this!
Excellent! Let me know if you have any questions.
super helpful! thanks a bunch
Good and simple tutorial. Thanks Jonathan
Very welcome Andoni - thanks for coming by!
you are really a great teacher
Thank you Aby. Much appreciated.
Thank you so much bro :))
And once again your video helped me a lot …. I was struggling with this editor and now I know how to deal with it:)
Thanks again 🍺🍺
You are not the only one. It definitely takes some getting used to. Most welcome 🚀.
Use the fixup option if you don't want the commit messages for the commits you're squashing
No way - I didn't even know you could do that. Trying now. Thanks Rachel!
Nice One... Please Do video on difference between merge and rebase
Thanks for the suggestion Lokesh. Merge just merges two branches together respecting the history. Rebase just replays your changes on top of the branch you rebase too. I prefer rebase, because that way I never mess up the branch I am merging too (any conflicts are my own). But I have heard others say they like merge for reason (though I am not sure why). Some googling will no doubt better explain the differences. That's my best explanation for now. Cheers and thank you for asking. Will see if I can create a video one day because it is a popular question.
Thanks for the handy commands Jonathan. Would be great if you could make a video about mirror a huge git repo. Let's say we have a huge git log history, as well the source code size. But new repository has a size limitation. So, what I would like to do, push only last a few commits to the new repo. I'll keep my original repo in origin, but mirror the new repo for less commits.
I just noticed that whenever I want to sync repos, do I have to take care of push commit (always commit after the last commit). I assume this command will push whole history `git push mirror master`
Or what is the best practice to reduce the size of log history (one way is squash yes but doing that will also take time), also in the past accidentally they have submitted SDKs source codes into the repo where it is root cause of the huge size...
Hi Nesim. Once option for reducing the size of a huge repos is to just create a new repos, copying the latest version in there, and then starting all over. Yes you lose the history, but if you don't really care it can greatly reduce the size of your repos - by starting fresh. All the best!
@@swiftarcade7632 Thank you very much for your kind reply. Yes, will go that way as it is temporary.
@ No problem. And good luck!
So you're not supposed to use --force ?! ...
Haha. You can use force. Just be careful :)
cwsquash
. to repeat