DEV Community

Cover image for The 15 Git Commands Every Software Engineer Uses (And Why They Matter More Than You Think)

The 15 Git Commands Every Software Engineer Uses (And Why They Matter More Than You Think)

Hadil Ben Abdallah on January 20, 2026

For a long time, I thought Git was just something I had to survive. Type a command. Hope nothing breaks. If it does… Google fast. I memorized com...
Collapse
 
anmolbaranwal profile image
Anmol Baranwal

I just remember the most useful ones and search it on the go. anyone wanting to learn git should check this out: udacity.com/course/version-control...

(the best free course out there with 2-3 min videos)

Collapse
 
hadil profile image
Hadil Ben Abdallah

That’s a very real and honest way most of us learn Git.

Remembering the core commands and looking things up when you need them is completely normal; even experienced developers do that. What matters is understanding what a command does to your repo, not memorizing syntax by heart.

And thanks for sharing the Udacity course; it’s a solid resource, especially with short videos that make Git feel less overwhelming.

Appreciate you adding a helpful resource to the thread 😍

Collapse
 
matthewpersico profile image
Matthew O. Persico

git worktree - always create a work tree THEN create a branch. Then instead of using git switch and

Switching branches with uncommitted changes and accidentally losing work

or git stash and

Stashing changes and forgetting they exist

just cd between worktrees to change context.

Collapse
 
hadil profile image
Hadil Ben Abdallah

That’s a great call-out! git worktree is seriously underrated. 😍

You’re absolutely right: using worktrees changes the whole mental model. Instead of juggling uncommitted changes, stashes, and risky branch switches, you just give each context its own working directory and move between them like folders.

I didn’t include git worktree because I was focusing on the most common daily commands, but this is a perfect example of how Git becomes calmer and safer once you go a bit deeper.
Thanks for sharing this, it’s exactly the kind of practical insight that helps teams avoid stress and lost work 💙

Collapse
 
thedevmonster profile image
Dev Monster

This is such a reassuring and practical read 🔥🔥

I really like how you normalize the fear phase of Git, the “type a command and hope nothing breaks” feeling is something almost every developer has been through but rarely talks about. Framing Git as a tool that protects you rather than judges you is a powerful mindset shift.

This is the kind of article that doesn’t just teach commands; it builds confidence. Really well done, especially for codenewbies who need clarity more than complexity

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much for this 💙 I really appreciate how thoughtfully you read it 😍

That “type a command and hope nothing breaks” phase is exactly what I wanted to normalize, because so many developers go through it quietly and assume they’re just “bad at Git.” In reality, it’s a shared experience; we just don’t talk about it enough.

I’m especially glad the “Git protects you; it doesn’t judge you” framing resonated. Once that mental shift clicks, learning Git stops feeling like walking on eggshells and starts feeling empowering.

Thanks again for the kind words and encouragement; it truly means a lot.

Collapse
 
shitij_bhatnagar_b6d1be72 profile image
Shitij Bhatnagar

Very nice article and loved the git merge pic/illustration, it's awesome :-D..

Few additional thoughts, one issue that is frequently faced when raising PR/MR is git not picking up history properly (i.e. changes are present in target branch but PR/MR still shows them as delta) and the second issue is that where we expect git to throw up a conflict (e.g. for a value), it may not do that.... so this calls for reasonable due diligence when working with git but again, due diligence is implicit when working with any config management tool anyways.

An additional aspect is that while the above commands are the base set, what code branching strategy is being used in the project also makes for some fun (mistakes, reverts, rebases etc.) in the development team(s), until we get used to one strategy and then the process changes for the next project or phase (e.g. we move from the historical git flow to the more pragmatic GitHub flow and so on).

Thanks for sharing your knowledge on git.

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much for taking the time to read and share such detailed insights! 😍

You’re absolutely right! Git can be full of subtle surprises, especially when it comes to PR/MR history or conflicts that don’t show up as expected. That’s why I always emphasize pausing, checking, and understanding the state of your repo before making changes; due diligence is critical, just as it is with any configuration management tool.

I also really appreciate your point about branching strategies. The commands are just the foundation; the workflow and strategy a team uses really shape how you interact with Git, and moving between strategies like Git Flow and GitHub Flow can definitely create new learning curves.

Thanks again for adding such a thoughtful perspective! 💙

Collapse
 
peacebinflow profile image
PEACEBINFLOW

This post is clean and honestly needed — because most people learn Git like it’s a haunted keyboard ritual: copy command, pray, ship.

I like the core point a lot: you don’t “master Git,” you master a small set of commands deeply, and that’s what makes you calm under pressure. The “Git remembers everything” framing is also real — Git isn’t judging you, it’s basically your timeline + undo button if you actually use it intentionally.

Only thing I’d add (because real teams = real chaos): the difference between revert vs reset is career-saving, and “check git status first” should be tattoo-level advice. Also shoutout to git diff — it’s the “read before you sign” of code.

Solid write-up. If a beginner reads this and practices these 15 until it’s muscle memory, they’ll stop fearing Git and start using it like what it is: controlled time travel.

Collapse
 
hadil profile image
Hadil Ben Abdallah

This comment genuinely made me smile. Thank you for such a sharp (and painfully accurate 😄) read.

The “haunted keyboard ritual” description is exactly how most of us were introduced to Git, and that’s the pattern I wanted to break. You captured the core idea perfectly: Git calm doesn’t come from knowing everything; it comes from deeply understanding a small, reliable set of commands.

And yes, 100% agree on your additions:

  • revert vs reset really is career-saving knowledge
  • git status first should be non-negotiable
  • git diff as “read before you sign” is one of the best analogies I’ve heard

If beginners walk away practicing these until they’re muscle memory, they don’t just “use Git”, they gain control over it.
Thanks again for the thoughtful breakdown and for adding so much value to the discussion 💙

Collapse
 
aniruddhaadak profile image
ANIRUDDHA ADAK

Very useful

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much! 😍 So glad you found it useful

Collapse
 
amirhossein_ln profile image
Amir

Great roundup this week 👏
Really enjoyed the mix — from the philosophical take on AI as “software” to very hands-on builds like the ESP32 face recognition and the Excalidraw animation engine.

Posts like these are exactly why I keep coming back to DEV: real problems, real solutions, and thoughtful perspectives.
Big congrats to all the authors featured 👏🔥

Always happy to connect with folks building interesting things in web, AI, and tooling

Collapse
 
hadil profile image
Hadil Ben Abdallah • Edited

Thank you so much, Amir! 💙

Collapse
 
kiran_ravi_092a2cfcf60389 profile image
kiran ravi

the representation is awsome

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you! 💙 That really means a lot 😍

I’m glad the representation resonated with you. I tried to reflect Git the way most of us actually experience it; a little intimidating at first, messy sometimes, but very learnable once you slow down and understand what’s really happening.

If it felt clear and relatable, then I’m happy it came across the way I hoped. Thanks for taking the time to read.

Collapse
 
kiran_ravi_092a2cfcf60389 profile image
kiran ravi

♥️

Thread Thread
 
hadil profile image
Hadil Ben Abdallah

😍😍

Thread Thread
 
kiran_ravi_092a2cfcf60389 profile image
kiran ravi

You are my fav dev ever ☺️💗

Thread Thread
 
hadil profile image
Hadil Ben Abdallah

Thank you so much! 🥰🥰🥰

Collapse
 
mezieb profile image
Okoro chimezie bright

Thanks for sharing

Collapse
 
hadil profile image
Hadil Ben Abdallah

You're welcome 😍

Collapse
 
ctechdiva profile image
Cheryl A

great review. Although with AI I am moving through these steps quickly using CLI and leveraging desktop ver of GitHub. But this is where I started

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much 😍

That makes total sense. AI and modern tooling definitely help move through these steps much faster now, especially with CLI helpers and GitHub Desktop smoothing out the rough edges.

What I really like about what you said is “this is where I started.” Even with better tools, that foundation still matters. When you understand what’s actually happening under the hood, the AI suggestions and UI buttons feel safer and more intentional, not just convenient.

Really appreciate you sharing that perspective 💙

Collapse
 
ctechdiva profile image
Cheryl A

As a reinforcement exercise, I may revisit these skills. When I used them daily, I almost didn't have to think about it. The tools quickly show the commands on the screen before executing, but it's not the same as using them yourself. I actually updated my keyboard recently, and there is something about doing this type of work with a good keyboard that makes the experience more enjoyable.

I will share that one thing I didn't like/still don't was having conflicts. Unfolding it was tedious, so I greatly appreciate the tool that resolves it, especially when there is more than one.

I've been mostly a reader here, but I will definitely be following your content

Collapse
 
samuel-braun profile image
Samuel Braun

git bisect 😎

Collapse
 
hadil profile image
Hadil Ben Abdallah

😎 Ah yes…

You’re absolutely right, git bisect is powerful, especially when you’re hunting down when a bug was introduced. It’s one of those commands you don’t use every day, but when you need it, it feels like a superpower.

I didn’t include it in this list because I wanted to focus on the daily-driver commands, but git bisect is a great example of how Git really shines once you start understanding history and intent.

Love the shout-out, that emoji was well earned 😄

Collapse
 
vasughanta09 profile image
Vasu Ghanta

Thanks for saving my time—I was about to write this but you beat me to it! 😂

Collapse
 
hadil profile image
Hadil Ben Abdallah

I’ll take that as a big compliment 😂 Thank you! 😍

I’m glad it saved you the effort and put into words something you were already thinking. That usually means it’s a shared pain point for a lot of us as developers.

Appreciate you stopping by and dropping this comment 💙

Collapse
 
anurag_upadhyay_55e3eaa02 profile image
Anurag Upadhyay

These are the most useful ones.

Collapse
 
hadil profile image
Hadil Ben Abdallah

Exactly! That’s the whole point 😍

Git isn’t about memorizing every single command; it’s about knowing the ones that actually make a difference in day-to-day work. Once you use these consistently and intentionally, everything else becomes easier to pick up as needed.

Glad to hear it resonated with you 💙

Collapse
 
hanadi profile image
Ben Abdallah Hanadi

This is exactly what every developer needs 🔥
Thank you so much for this breakdown @hadil

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much! 💙

I’m really glad it hit the mark; that was exactly what I hoped for: a breakdown that’s practical, approachable, and actually helps developers feel more confident with Git.

It means a lot to hear it resonated, especially knowing how many of us have gone through that “type a command and hope nothing breaks” phase. 😍

Collapse
 
shadcndeck_dev profile image
ShadcnDeck Dev

Great list, and nicely written!

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much! 😍

I’m really glad you enjoyed both the content and the writing; that means a lot. I tried to keep it clear, practical, and relatable so it feels useful rather than overwhelming.

Appreciate you taking the time to read and leave such kind feedback 💙

Collapse
 
aidasaid profile image
Aida Said

This is such a practical read.
Every developer should read this 🔥

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much! 😍

I’m really glad you found it practical; that was the main goal. Git can feel overwhelming when it’s taught abstractly, so I wanted this to be something developers could actually recognize from their day-to-day work.

If it helps even one developer feel calmer and more confident the next time they open a terminal, then it’s done its job.
Thanks a lot for the encouragement 💙

Collapse
 
harry_1a8f532dd1670a9f692 profile image
Harry • Edited

Actually there's only 1 command and 1 button you need to know.

  1. "Commit this to source control I don't know what's happening"
  2. Find "Yes", Press enter
Collapse
 
hadil profile image
Hadil Ben Abdallah

Honestly… that button has carried a lot of projects through the years 😂

That said, it’s funny because it’s also a little too real; most of us started exactly there: “I don’t fully know what’s happening, but please save this somewhere safe.”

The whole goal of the article was to help people move one step past that button, from blind trust to intentional control. Once you know what that commit actually represents, Git stops being scary and starts being useful.

Appreciate the humor and the truth behind it 😄

Collapse
 
akanksha_soni_fef78545fe7 profile image
Akanksha Soni

This is such a interesting , informative and good read , Amazing

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much. I really appreciate that! 😍

I’m glad you found it interesting and informative. My goal was to make Git feel less intimidating and more approachable while still being genuinely useful in real-world work.

Thanks a lot for the encouragement; it truly means a lot 💙

Collapse
 
mebularts profile image
Mehmet Bulat

Hey, that was really fun!

Collapse
 
hadil profile image
Hadil Ben Abdallah

Hey, thank you so much 😍 That makes me really happy to hear!

I’m glad it felt fun as well as useful. Git doesn’t have to be stressful or dry, and if the article made the learning process feel a bit lighter, then it did exactly what I hoped.

Really appreciate you taking the time to read 💙

Collapse
 
seo_seo26master_29e8b33e6 profile image
SEO seo26master

Teaching developers to pause, check status, and move forward calmly is the essence of sustainable Git workflow mastery.

Collapse
 
hadil profile image
Hadil Ben Abdallah

That’s beautifully put! and exactly the mindset I was aiming for. Thank you! 💙

So many Git problems don’t come from lack of knowledge but from rushing while feeling stressed. Pausing, checking git status, and then acting deliberately sounds simple, but it’s a habit that changes everything.

Once that calm workflow becomes natural, Git stops being something you react to… and becomes something you use with confidence. I’m really glad that message came through; appreciate you sharing this insight 😍

Collapse
 
marketertools profile image
Marketer Tools

Very good!

Collapse
 
hadil profile image
Hadil Ben Abdallah

Thank you so much! 😍

Collapse
 
charlesbasis profile image
Charles Valerio Howlader

Thanks for sharing!

Collapse
 
hadil profile image
Hadil Ben Abdallah

You're welcome 😍