Git Internals - Git Rebase

preview_player
Показать описание
In this video we understand the super powerful tool - git rebase.

This is part 4 of a series about Merge & Rebase. In Part 1 we covered Diffs and Patches. In Part 2 we covered the basics of Merge, and Part 3 elaborated on Advanced Merges. The next part will be a recap of this series.

If you want to play around with the repository I used and try out the commands for yourself - you can get the repo here:

======================
`git lol` alias:

git-graph (my alias is `gg`):

======================
Additional resources about Rebase:

======================

📕 My book "Gitting Things Done" is officially out!

Or read it for free at:

======================

======================
☕☕☕ Support this channel:
My mission is to create free, accessible, visual and practical tutorials. If you would like to support me on this, you can buy me a coffee :)

Thank you!!
======================

======================
How do I make videos?

I often get questions about the tools I use to create Videos - so here they are :)

(When available, I may use affiliate links and may earn a commission, with NO additional cost to you)

======================

Video created by Omer Rosenbaum. All rights reserved.
Рекомендации по теме
Комментарии
Автор

Thank you so much for sharing those amazing Git video tutorials! The quality was truly exceptional, and I found them incredibly helpful in expanding my understanding of Git. Your efforts in creating such valuable content are greatly appreciated. Keep up the fantastic work, and please continue sharing your knowledge with the community.

mohamedbelkacem
Автор

29:39 a mistake here... the parent of commit 17+19 is commit 15' instead of 14'

magno
Автор

you say i should find comits to apply at the top of the active Branch when rebasing, but for example if history derives and merged again: for example commit1 then derives in to branches commit2 and commit3 for example, and then commit2 also derives into commit4 and commit5 and then merged into merge commit 6, and what if i want to rebase branch that had derived history(that starts from commit2) to the top of the branch starts at commit 3? Diff(x, parent(x)) if x have two parents

АртемЖуравский-уй
Автор

All this example using rebase are valid when we don't have conflits, we just want rewrite the history, right? To deal with conflits merge still the better aproach, or am i wrong?

flaviohenrique
Автор

Thank you for this great video, I'm learning so much from it! I have one question - why at 29:44 Commit 17+19 is pointing to Commit 14 and not Commit 15?

lisowisko
Автор

Hi, I have a question. While re-ordering the base for the first commit of a branch in the tutorial - time : 22:15, you didn't checkout to the branch "new_branch" before applying "git rebase --onto". You applied it while you were in the main branch. But in the second case(time: 25:27) you checkout to the branch "feature_2" before proceeding with the "git rebase --onto". Can you help me on this please.

basudevbhattarai
Автор

QUESTION :

Any commit is full snapshot of stagging Area or just changes what they rememberd?

I tried myself and found commit is not a full snapshot but only changes which they know.
create master branch file_1 created ( 1st commit) .
Now checkout "feat" branch.
Do a 2nd commit file_2 created.
Do a 3rd commit file_3 created.
Do a 4th commit file_4 created.
Do a 5th commit file_5 created.
Do a 6th commit file_6 created.
Do a 7th commit file_7 created.

Now "git switch master".

git cherry-pick "7th commit hash"

And boom..
In master you see only file_1 and after file_7 created.
Not a full snapshot. ( I mean even 7th is latest commit in feat but it doesn't have full snapshot, just their changes what they remember at that time).

That's why file_2 to file_6 are not comes in the master.
Because we use cherry pick and not merge.

DhavalAhir
Автор

Great video, I'm getting a lot of value from it and I think I'm gonna watch all your other videos as well :D

Just one question, at 18:47 you rebase paul_branch on main to squash commits 7 and 8. Isn't the chart on the right, wrong?
You applied there the changes to 7' and 8' but in fact on the terminal on the left you squashed 7 and 8.

Thank you!

DevLeonardo
Автор

thank you! btw can you please write the equation of area the white color used on your t-shirt?)

qwer