DEV Community

Cover image for Git Explained: An In-Depth Comparison

Git Explained: An In-Depth Comparison

Milu on May 16, 2020

Git is a very powerful tool and It has a long list of capabilities available at your disposition. Some commands provide slightly similar results an...
Collapse
 
rbukovansky profile image
Richard Bukovansky • Edited

Hi Milu,
your Git introductions seems to be great, but I have real issue with that "git merge" graph. When you merge, Git doesn't "flatten" the graph, only creates a new commit that will have two parents (green commit #3 and orange commit #3). Green commit 3 will never have orange commit 1 as its parent commit. If so, the green commit 3 would have different hash and the rest of the commits (orange 2 and 3) as well and you would be in same situation as with rebase.
Please, redo that graph.
Thanks.

Collapse
 
milu_franz profile image
Milu

Hi Richard,
Your comment made me realized my visualization was definitely misleading. I've updated it to reflect that a new merge commit has two parents. Thank you for the feedback!

 
milu_franz profile image
Milu

That is a really great topic, especially since I've also been in that situation in the past (probably most developers have experienced it too). I will make sure to add it in a future post.
Thanks for the suggestion Javier!

Collapse
 
milu_franz profile image
Milu

Thank you for taking the time to ready my post, Javier! I'm glad the illustrations are helping. Please let me know if there is anything else about git you would like to learn more in a future post :)

Collapse
 
vitalykarasik profile image
Vitaly Karasik

"This is a destructive operation as it moves an entire branch’s history on the tip of another one by rewriting the project history with new commits." - there is a typo, 'on the top'.

Collapse
 
milu_franz profile image
Milu

Thanks for catching that typo, Vitaly! I fixed it :)

Collapse
 
adzika profile image
adzika

Thanks, Milu! I find Git a bit scary and it's great to see commands so clearly and simply explained. The drawings make it so much easier to understand.

Collapse
 
milu_franz profile image
Milu

Hi! I'm glad you are finding my explanations and drawings easy to follow. Thank you for reading and the kind words!

Collapse
 
franciscosuca profile image
franciscosuca

Amazing post! this was the simplest explanation about Merge and Rebase differences that I have seen so far!

Collapse
 
milu_franz profile image
Milu

Thank you Francisco! :)

Collapse
 
aftabksyed profile image
Aftab Syed

Very nice post by creating a 5 part series which is easy to learn 👍

Collapse
 
milu_franz profile image
Milu

Glad you found it easy to understand Aftab! And thank you for reading :)

Collapse
 
enriqueedelberto profile image
Edelberto Enrique Reyes

Thanks for sharing. I love it.
Good job

Collapse
 
milu_franz profile image
Milu

Thanks for the support and encouragement Edelberto! I truly appreciate it.

Collapse
 
jsifontez profile image
Juan Sifontez

Incredibly Milu! I like the way that you explained. I never use a reset (just reset HEAD to undo changes of staged before commit) but now I understand it and I'll try to use it. Thanks for all.

Collapse
 
milu_franz profile image
Milu

Thank you Juan! I'm happy you found my git reset explanations useful, I find it to be a very powerful command and personally enjoy using git reset --soft often. Let me know if there is anything else about git you would like me to explain in a future post! :)

Collapse
 
monescse profile image
Monesul Haque

what tools did you use to make that illustrations/visualization ?

Collapse
 
milu_franz profile image
Milu • Edited

Hi Monesul, I used an app called Paper Pro and Photoshop to make my cover image.