DEV Community

Cover image for How I teach Git

How I teach Git

Thomas Broyer on November 26, 2023

I've been using Git for a dozen years. Eight years ago, I had to give a training session on Git (and GitHub) to a partner company about to create a...
Collapse
 
zalithka profile image
Andre Greeff

damn.. I thought this would make a nice quick lunch break read, but there is so much to unpack here, I'm going to have to bookmark this and come back to it later this evening.

FWIW, I've been using Git myself for well over a decade already, many times needing to help explain the system to other people.. with that said, just skimming through the first few paragraphs I can tell that even I still have a lot to learn about it...

Collapse
 
soanvig profile image
Mateusz Koteja

Finally some good quality post on dev.to.
I would add also add some helper tools, for example to improve experience of logging (like cdiff) or for interactive rebasing (git-interactive-rebase-tool), changing the default editor used, maybe mention signing commits (with PGP for example). Besides that: awesome.

Collapse
 
crazycga profile image
James

Holy poop! DEFINITELY bookmarking this so I can refer back to it with juniors and even intermediate users. Excellent descriptions especially of cherry pick and rebasing. Damn fine content, thank you for it!

Collapse
 
ademagic profile image
Miko

Abandon all hope ye who enter here thinking this will teach you Git real quick. Go look for a cheatsheet or something.

Great read though, been using Git for 10+ years and I still got a lot from it just skim reading. Quality post!

Collapse
 
stefanmoore profile image
Stefan Moore

A lot to unpack in the short amount of time I have to read. The title image made git understandable in 30 seconds. This will be bookmarked for review later.

Collapse
 
tbroyer profile image
Thomas Broyer

Yes, I really like that image, and all of Mark Lodato's Visual Git Reference: marklodato.github.io/visual-git-gu...

You'll quickly see I only link to 3 learning sources, and that one is much more "joyful" than Pro Git for similar diagrams.

Collapse
 
stefanmoore profile image
Stefan Moore

Thanks, that has been bookmarked!

Collapse
 
vraa profile image
Veera

This is very informative. I remember printing the git fetch / push flow diagram and paste it on my cubicle when I started learning Git. Changing the mental model from Subversion to Git was one of the main challenge.

Collapse
 
harshitkumar31 profile image
Harshit Kumar

I always refer learngitbranching.js.org/?locale=e... to my colleagues & juniors.

Collapse
 
srtechwriter profile image
marcia wilbur

I've taught git to engineers and tech writers at Intel and in User Group Meetings in Arizona. How I teach git to Windows users with git bash. 1. Have high hopes 2. Have those hopes crushed 3. Keep explaining what a terminal is. 4. Instruct commands over and over. 5. No... not the command prompt - Git bash! It takes time, but even a novice can get it... Now resolving conflicts... CI/CD... yea. It's a process.

Collapse
 
markuptitan profile image
Samson Lukhele

I am not saying they were bad but where I learnt Git and VCS they never mentioned any of that. Matter of fact we had to learn hashes on our own and now that I am seeing hashes being an integral part of Git and the commits(I never read the documentation at git-scm) I am even more intrigued on how much is hidden with learning git..This is all really great and invaluable information especially for a beginner like me.

Collapse
 
hasanelsherbiny profile image
Hasan Elsherbiny

👏👏

Collapse
 
proteusiq profile image
Prayson Wilfred Daniel • Edited

Thank you for these. I will embrace it in my way of teaching git. I discovered that I learn more myself by teaching. The Protégé Effect.

Collapse
 
darius410 profile image
Darius

As someone who has a guilty of having a simple work flow and had to do a rebase without knowing what one is.I totally need to bookmark this and re work my understanding of git.

Collapse
 
sleepstorm profile image
Nikhil Harry

Hi, I think this is an awesome post. I was just wondering if anyone knew how to make captions for images the way he does.

Collapse
 
tbroyer profile image
Thomas Broyer

This is HTML actually:

<figure>
  <img src= alt= with= height=>
  <figcaption>Your caption here, <b>with</b> <code>HTML</code> if you want</figcaption>
</figure>
Enter fullscreen mode Exit fullscreen mode

DEV sanitizes the content so you can't put any kind of HTML in your markdown, but <figure> is one that's accepted.

Collapse
 
sleepstorm profile image
Nikhil Harry

That makes sense, thank you. Is it okay if I use the code in my posts? Also, I just wanted to say, I read some of your other posts and wanted to say that they are well thought out and written. Keep up the good work 👍.

Collapse
 
usamanisarkhan profile image
usamanisarkhan

This is interesting

Collapse
 
martinkr profile image
Martin Krause

Great Post!

Collapse
 
janmpeterka profile image
Jan Peterka

Great article!
There's one thing to improve though - those images are not very readable in dark mode 😅

Collapse
 
minarhossain profile image
Minar Hossain

Nince

Collapse
 
ladyxena profile image
ladyxena

This is juicy, thanks for sharing