DEV Community

Cover image for 10 Must-Know Git Commands for Every Developer

10 Must-Know Git Commands for Every Developer

Mukesh Kuiry on January 05, 2024

Understanding Git and GitHub is crucial for any developer, providing effective version control and code management. Proficiency in these tools sets...
Collapse
 
random_ti profile image
Random

Awesome Guide on Github Commands 🔥

Thanks for sharing this💖

Collapse
 
mukeshkuiry profile image
Mukesh Kuiry

Thanks for appreciation! ❤️

Collapse
 
issa1960 profile image
ISSA NDAGI UMARU

Wow interesting 👍🏾

Collapse
 
soansuiyan profile image
SoanSuiyan

prueba

Collapse
 
tijuana22 profile image
Tijuana Hunt

Thanks for sharing!

Collapse
 
omi profile image
Omi

that was great, but im stil confused on git resest part
could u just had added some visualize or example would be better

Collapse
 
mukeshkuiry profile image
Mukesh Kuiry

For example, your company wants to ship their product every Saturday night, but you, as a developer, mistakenly committed the changes before Saturday to the main

In that case, you need to remove the changes from the main branch. Removing the changes one by one may be complex. In that case, you just need to run the git reset command to remove the last commit.

Hope that makes sense.

Collapse
 
dev_saheb profile image
NayemulSCode

really good article 👌

Collapse
 
vepifanio profile image
Victor Epifânio

Awesome content!
Thanks for sharing! 💖

Collapse
 
drgrey profile image
Dr-Grey

Would probably be a good idea to include a script that'd run on demand or per schedule that does pull for number of branches specified .

Collapse
 
mukeshkuiry profile image
Mukesh Kuiry

Yeah, that's a good idea, but it may not be efficient for the project, which took a long time to build. As it may be more prone to errors, like conflicts.

Collapse
 
sripartha99 profile image
Parthasarathy

Thank you for sharing such powerful git commands... Very useful 😀👍🏻

Collapse
 
dipayansukul profile image
Dipayan Sukul

Good content for those who are starting up.

Collapse
 
mukeshkuiry profile image
Mukesh Kuiry

Yeah, thanks 🙏

Collapse
 
ooosys profile image
Info Comment hidden by post author - thread only accessible via permalink
oOosys • Edited

The issue I am experiencing with all the git tutorials up to now, including this one, is that they are based on git terminology which is poorly explained in first place, leaving room for contradictions making all the explanations useless. Let's take a look at the terms: repository, working directory and staging. In order to understand git I need a clear mental model of what git does and how. Explanations which change very quickly to the git vocabulary for describing what git does are not helpful. The general rule is that once you have got a concept to a level you start explaining you have lost the ability to see it from the perspective of knowing nothing about it and therefore unable to explain to someone who has trouble to grasp what it is all about, because up to now never in the actual need for coordination of a huge number of developers lacking therefore the awareness about what is needed, what for and why. In other words a well done explanation will first describe a well chosen and described case where with usual means it would be hard to impossible to accomplish something. This followed by the explanation of a solution would much more help to get the idea, the concept behind it all. In last step the vocabulary used as shortcut for lengthy descriptions can be presented making the meaning of git commands obvious.

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

Don't expect much of AI-created, artificially upvoted articles.

Collapse
 
ooosys profile image
oOosys

How to know which ones are they in first place before spending time on reading them?

Thread Thread
 
webjose profile image
José Pablo Ramírez Vargas

Artificially upvoted articles are the ones that usually start with 5 reactions: One reaction each (heart, unicorn, mind-blowing, etc.). A few "authors" have access to more fake/bot accounts and their articles start with more reactions, but usually all individual reaction counts will be the same.

AI-created articles usually follow 2 or 3 very specific patterns, but most have a Conclusion section, use bulleted or numbered lists rather heavily and title hierarchies are always there. You'll get the hang of those rather quickly.

Collapse
 
wesborland profile image
Marcos Javier Gomez Hollger

Oh, thanks... Very useful! ❤️

Collapse
 
anickacodes profile image
Nicki

Very nice & detailed! Thank you

Collapse
 
azharvalley profile image
Kamal Azhar

It's handy and day to day used git command.
Nicely explained.
Cheers!

Some comments have been hidden by the post's author - find out more