Thanks for the video. I always had a rough understanding of git rebase vs git merge, but I was never taught when would be a good idea to use it for each use case.
@@Ihatetomatoes ok, this is my flow when I am on a feature/ git status (up to date), gitk --all (to check eventually the level of commit done on my branch), git checkout develop -> git pull (to update my local develop), git merge if conflict then push eventually, git checkout feature/ now imports all changes from develop -> feature/, git rebase develop and resolve conflict if present, gitk --all (verify the order of commit), the trick I use: git push -f (force) and not pull, that way the commit are ordered as You well explained in your videos, it's time to merge my branch so verify the branch is up to date, then checkout develop again, git merge feature/ (normally now the commit and the history are well ordered and everything works correctly), verify gitk --all (to check the feature and develop remote and locally are at the same level)
Thanks for the informative video. What would happen if there is merge conflict and how the commit history will look like in that scenario ? Can you please post some video on this scenario ?
Thanks for the explanation. I prefer to use squash and merge most of the time since it allows to revert one commit in case of problem instead of reverting 20 commits if you use rebase. Moreover if you use merge without squash it is even harder. If you are following semantic release using the commits name, then it a lot reasonable to use squash since you want to version your product based on the commit names, fix, feat, !breaking changes. I think rebase can be nice thing when the order of commits is matter to you, or when you want to merge release branch to master and develop. I can't really think about a way that I would really want to use rebase instead of squash and merge. I would be glad if you will give me a scenario that I would need the rebase instead. The thing that nice here is the interactive mode, that you can change the commit names and make it more friendly, but other than that, I can't really find a real advantage.
Hi, great video! Would you mind mentioning what extension you're using to display the branch data in your terminal like that, just to the left of your cursor prompt? Thanks.
If by 'my-branch' you mean the master branch, and judging from the diagram that is the case I think it's better to switch to 'his-branch' and do git rebase my-branch. Then when we switch back to 'my-branch' and do the rebase against 'his-branch' we'll have the incoming commits atop of ours and no rewrite of the commit IDs that we care about will occur. Source: ruclips.net/video/f1wnYdLEpgI/видео.html
It looks like the zsh agnoster theme. Install that and you'll get the fancy looking terminal. If you're looking to change the colours on ur vscode on mac you can get a hacky solution (I just did this this morning) by adding the following lines to settings.json (if you don't have the iterm terminal then u can delete the linuxExec and osxExec lines): "terminal.integrated.fontFamily": "MesloLGS NF", "terminal.external.linuxExec": "iterm", "terminal.external.osxExec": "Iterm.app", "workbench.colorCustomizations": { "terminal.ansiBlue": "#ADADAD", "terminal.ansiBlack": "#424242", "terminal.ansiGreen": "#00c5c7" },
hi! thanks for the video. Can you tell me which software are you using for the animations?? I need to visualize something for my job and it would be cool to add a little bit of life into it.
I did exactly what you explained: git rebase -i ColeagueBranchName but I got the Fatal: Needed a single revision. Invalid Upstream Error. What could be wrong ?
u typed the wrong branch thats why. example assuming u created a new branch named it (obi) while urs is (main) to rebase then first switch to main by typing $git checkout main to rebase use below command $git rebase obi Note: remember I used main to give u a reference and its not good to rebase ur public branch, which is main u can create more than one branch and rebase in that branch. I started learning git 20days ago and i think i have made some litttle progress, we can be friends. am in chapter 3.6 Git Branch Rebase. i was confused so i have to look for video tutorial that explains that very well. though i still prefer git merge because this wont override ur work, it will only copy what i did not have to ur main. though having good understanding how rebase works is good, because i will still need it in the future. my instagram id is @mathewtechhub am also on discord too
You can branch of another branch but if that branch is rebased you will have some issues. I recommend using rebasing only on your local branches that are not publicly pushed remote.
This video's example is so simple, non-real world that it was not helpful. If you are going to go through the trouble of making a How To video, don't cut corners. Sheesh!
I love this guy !
git Rebase: done and dusted. Thanks to this Guy.
Thanks, bother, your diagrams/animations were a great help, without them it would have been difficult to get it
1:15 git rebase
4:28 diagram
6:24 git reflog
Essence of the video is here 4:24. Thanks I really learnt something.
ur right
Hey mate! Where are you? Just discovered your channel, awesome material. I hope you can continue with more! 💪
Hey mate, not having enough spare time to create more content, great to hear that you find my videos useful. I will be back one day😂
best explanation on youtube
Thanks for the video. I always had a rough understanding of git rebase vs git merge, but I was never taught when would be a good idea to use it for each use case.
excellent Petr! I use rebase quiet often since I work as a fullstack
Thanks Daniel. Have you had any issues with rebase? Or do you have any tips on rebase? When to use and when not?
@@Ihatetomatoes ok, this is my flow when I am on a feature/
git status (up to date),
gitk --all (to check eventually the level of commit done on my branch),
git checkout develop -> git pull (to update my local develop), git merge if conflict then push eventually,
git checkout feature/
now imports all changes from develop -> feature/,
git rebase develop and resolve conflict if present,
gitk --all (verify the order of commit),
the trick I use: git push -f (force) and not pull, that way the commit are ordered as You well explained in your videos,
it's time to merge my branch so verify the branch is up to date,
then checkout develop again,
git merge feature/ (normally now the commit and the history are well ordered and everything works correctly),
verify gitk --all (to check the feature and develop remote and locally are at the same level)
@@daniellaerachannel greeat to hear your workflow, very usefule for anyone going through these comments, really appreciate it.
Thanks for the informative video. What would happen if there is merge conflict and how the commit history will look like in that scenario ? Can you please post some video on this scenario ?
I don't hate tomatoes, but your channel name and icon are hilarious.
Sir, this was amazing!
Thank you!
as you can imagine, you are a life-saver lol. Thank you for the explanation!
Thanks Luiz, happy to save your life 🤣
Thanks for the explanation.
I prefer to use squash and merge most of the time since it allows to revert one commit in case of problem instead of reverting 20 commits if you use rebase. Moreover if you use merge without squash it is even harder. If you are following semantic release using the commits name, then it a lot reasonable to use squash since you want to version your product based on the commit names, fix, feat, !breaking changes. I think rebase can be nice thing when the order of commits is matter to you, or when you want to merge release branch to master and develop. I can't really think about a way that I would really want to use rebase instead of squash and merge. I would be glad if you will give me a scenario that I would need the rebase instead.
The thing that nice here is the interactive mode, that you can change the commit names and make it more friendly, but other than that, I can't really find a real advantage.
ur examples, was helpful God bless u
Thanks for the nice explanation of git merge vs git rebase
Thank you, that's great to hear.
I would like to thanks u brother, I have a full day trying to solve this lol
Thanks for the video! That made understanding the basics of rebase easy and quick!
Thank you. It is really a very helpful video to on Git rebase.
Hi, great video! Would you mind mentioning what extension you're using to display the branch data in your terminal like that, just to the left of your cursor prompt? Thanks.
If by 'my-branch' you mean the master branch, and judging from the diagram that is the case I think it's better to switch to 'his-branch' and do git rebase my-branch. Then when we switch back to 'my-branch' and do the rebase against 'his-branch' we'll have the incoming commits atop of ours and no rewrite of the commit IDs that we care about will occur. Source: ruclips.net/video/f1wnYdLEpgI/видео.html
Nicely explained, thank you
Thank you!
How do you configure the terminal in vscode to colors like that ?
It looks like the zsh agnoster theme. Install that and you'll get the fancy looking terminal. If you're looking to change the colours on ur vscode on mac you can get a hacky solution (I just did this this morning) by adding the following lines to settings.json (if you don't have the iterm terminal then u can delete the linuxExec and osxExec lines):
"terminal.integrated.fontFamily": "MesloLGS NF",
"terminal.external.linuxExec": "iterm",
"terminal.external.osxExec": "Iterm.app",
"workbench.colorCustomizations": {
"terminal.ansiBlue": "#ADADAD",
"terminal.ansiBlack": "#424242",
"terminal.ansiGreen": "#00c5c7"
},
Thank you, the explanation was precise and easy to understand.
Useful video. Got good understanding about Git Rebase. Thank you.
Thanks for sharing this video. It's definitely helpful!
+1 for my battle against the git wizards
thankyou so much this helped me out a lot
Which plugin is this that you use showing branch names in vscode terminal?
well explanation , thank you sir
Great tutorial Sir XD !!!!
After giving git log how to get out of it. I'm closing terminal to write the next commands. Thanks
hi! thanks for the video. Can you tell me which software are you using for the animations?? I need to visualize something for my job and it would be cool to add a little bit of life into it.
great stuff~ very helpful
good stuff brother!
I am not afraid of rebase now... But my boss wants me to squash too, and the fear is strong again.
same as me, even if am to rebase i will never do it on my main.
Thanks a lot! It is good
Great video - thank you!
I did exactly what you explained: git rebase -i ColeagueBranchName but I got the Fatal: Needed a single revision. Invalid Upstream Error. What could be wrong ?
u typed the wrong branch thats why. example assuming u created a new branch named it (obi) while urs is (main) to rebase then first switch to main by typing $git checkout main
to rebase use below command
$git rebase obi
Note: remember I used main to give u a reference and its not good to rebase ur public branch, which is main u can create more than one branch and rebase in that branch.
I started learning git 20days ago and i think i have made some litttle progress, we can be friends.
am in chapter 3.6 Git Branch Rebase. i was confused so i have to look for video tutorial that explains that very well. though i still prefer git merge because this wont override ur work, it will only copy what i did not have to ur main.
though having good understanding how rebase works is good, because i will still need it in the future.
my instagram id is @mathewtechhub am also on discord too
Awesome video, does it mean I should never branch off another branch?
You can branch of another branch but if that branch is rebased you will have some issues. I recommend using rebasing only on your local branches that are not publicly pushed remote.
Superb
Haha listened to this on double speed
Very well, thank you. Can you please put a video on "squashing commits while rebasing" ?
Yes I can, it is coming up soon :) anything else?
Thank you, I will now destroy a tomato!
im here.. bcasue im confused
you look like bill burr ngl
This video's example is so simple, non-real world that it was not helpful. If you are going to go through the trouble of making a How To video, don't cut corners. Sheesh!
I hate tomatoes too
what are the odds
u hate tomatoes? so no pizza?
oof.
Pizza is great, just not with fresh tomatoes 😂
you look like a skinny bill burr