Git Fundamentals
The pragmatic guide that teaches what actually matters and helps you to finally use Git with confidence and intention.
What are the "fundamentals" of Git?
Git has a reputation for being complicated and difficult to learn, so it's important to know which parts to learn and why. The better your habits and the more accurate your mental model of what you are doing, the less you will need to rely on exotic commands, panicked Google searches, and inefficient workarounds.
In the context of this guide, we consider the fundamentals to be the things you need to know in order to use the tool effectively and confidently. The fundamentals are different from the "basics" or the "bare minimum to get started". They are the underlying concepts, mental models, and the "why" behind your actions with the tool, especially in collaboration with others.
Many of the concepts, practices, and habits are not Git-specific and apply in the same or a similar fashion to other version control tools.
Who should read this guide?
This guide is intended as "the guide you wish you had when you started out". It's mainly for the following kinds of software developers:
- You're in the beginning of your career or new to Git and want to learn it "right" from the start. Learning it "right" includes actually understanding what you're doing, building good habits, and awareness of common pitfalls to avoid.
- You're an experienced developer, but never really actually understood Git. You can use it reliably for the basic operations (commit, push, pull) to collaborate with others ‒ as long as nothing goes wrong ‒ and you may even be an expert in some areas of software development, but you feel like you never really understood Git. You struggle with complicated branching models, merge conflicts, and difficult releases. Maybe you progressed quickly in the beginning of your career due to talent or motivation and skipped some basics or you learned from seniors who then were in the situation you are in now.
- You're a senior developer or tech lead and want a guide that shows you what you might already be doing subconsiously, to help you help others. Experts do many things subconsciously (many good habits, but probably also some bad habits), which can make it difficult to teach others. It seems "obvious" to you, but you can't really explain it? Then this guide gives you awareness and a vocabulary.
How many of us learn Git.
Image by XKCD, licensed under Creative Commons "CC BY-NC 2.5"