Git rebase is not that scary
ฝัง
- เผยแพร่เมื่อ 26 พ.ย. 2024
- Git Rebase may seem daunting, but it's a powerful tool that, when understood, can significantly streamline your workflow. In this video, AES demystifies the Git Rebase process, explaining when and how to use it effectively. Many developers are cautious about using Git Rebase due to its ability to rewrite history, which can lead to unintended consequences if not used carefully. However, AES highlights that with proper understanding, this command can be a cleaner alternative to merging, eliminating unnecessary commits and maintaining a linear project history. The video walks through practical scenarios, demonstrating how to safely perform a rebase on feature branches, avoiding common pitfalls like rebasing on the master branch. By the end, you'll see that Git Rebase isn't as scary as it seems-it's a valuable tool in your version control toolkit, provided you know what you're doing. Whether you're managing a simple project or collaborating in a large team, mastering Git Rebase can help keep your project history tidy and easy to understand.
Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.
All the learning resources such as code files, documentations, articles and community discussions are available on our website:
chaicode.com/
You can find our discord link, github link etc on the above website.
Twitter/X link: x.com/hiteshdo...
Discord link: hitesh.ai/discord
Learn React with 10 projects: • Let's learn react from...
Learn Docker: • A practical guide on D...
Learn Kubernetes: • Complete Kubernetes Co...
How does a browser works: • How does a browser wor...
How nodejs works: • How node JS works | En...
Learn Redux-toolkit: • Learn Redux Toolkit in...
Learn NextJS: • Nextjs Full stack course
Learn Typescript: • Why to learn Typescript
Learn Javascript: • Welcome to new JavaScr...
Learn React Native: • React Native Mastery: ...
Learn Zustand: • React state management...
Learn Golang: • How to get started wit...
suppose M1, M2,... mean commits in master branch and B1, B2, ... means commits in a particular branch. if you go to that branch and run git rebase master it does this:(M3 added as new commit before B1, B2 in branch's log)
B1->B2 B1->B2
^ ^
M1->M2->M3 M1->M2->M3
and if you do the opposite, the main branch is shifted along the branch which is a problem. (B1,B2 added as new commits before M3 in master's log)
B1->B2->M3...(master continues here)
^
M1->M2
Nope! That's not how it works. Rebase is not going to create any additional commits.
If you switch to branch B and run git rebase master, you will get:
M1 -> M2 -> B1 -> B2
This will happen on branch B.
In case you mess up the rebase but you haven't removed .git folder, you can use git reflog to get commit history before rebase. Rebase is really not hard. I find it's the same as cherry-pick. Btw you should also show git rebase -i and squash, edit and things.
hey bro need some help with git stashing, is there any way that i can contact u
@@tarun-d1t my simplest advice after insane amount of my best years with git: never ever touch stashes even with the longest stick in the world. They are like branches, but are simply incredibly limited. Absolutely no business value compared to branches. Just master branches and that would be enough for everything you may ever need.
Add more comments guys don't only see content and go away.
Atleast this man deserves a like and share.😊
thank you Hitesh, awesome description
Thank u for sharing such content. Really good content
best git course out there
What is the difference between rebasing from master and feature branch?
Thumbnail is so nice
Don’t forget to force push with a “git push -f” when doing a git rebase.
Cool, Very information and important.
Thank you so much ❤
what i learnt here is I don't care about the history so I don't care if their is a command called `git rebase feature ` .... :)
This was really very informative!!
what terminal are you using?
Ho gaya bhai
Thank you so much sir❤
The main keypoint: NEVER DO REBASE ON MASTER/MAIN BRANCH... NEVER
you really are a great teacher
Thanks!!
Thank you sir ji
Thank you Sir
#git #github
thanks ❤
what about abort? it will end everything?
Can you provide notes ?
got the concept of rebase clear...
everyone please share this
I'll watch this video again 1 or 2 times to get clear idea.
Now i understand it a bit better 😅
💯💯🎉🎉
Just scratched my head with the rebase over a os contribution and this video is like how I approached it but it took hours for me😂
you can see the differene b/w didi bhiya course and hitseh sir's lectures
❤
❤❤
Continue AWS after this
Jesus is my Master 🙏💙🕎✝
Jesus is prophet ❤
comment
Day 7 present
❤