Copyright 2023 Anna Skoulikari. All rights reserved.
Printed in the United States of America.
Published by OReilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.
See 0636920728078 for release details.
The OReilly logo is a registered trademark of OReilly Media, Inc. Learning Git and related trade dress are trademarks of OReilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and OReilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps.
Although the publisher and author have used reasonable care in preparing this book, the information it contains is distributed as is and without warranties of any kind. This book is not intended as legal or financial advice, and not all of the recommendations may be suitable for your situation. Professional legal and financial advisors should be consulted, as needed. Neither the publisher nor the author shall be liable for any costs, expenses, or damages resulting from use of or reliance on the information contained in this book.
[ Preface ]
I never thought I would write a book teaching Git . But through a fortunate series of events I found myself with a creative idea for how I could teach this technology in a simple way.
My journey started when I attended a coding bootcamp to learn web development after which I got a job working as a junior frontend developer working on a website in a big company.
The teachers at the coding bootcamp briefly introduced Git to the students, but given that all our projects were done individually, we didnt have to use it extensively.
My real Git learning journey began on the first day of my new job. In those first months, I worked as a junior frontend developer as part of a team in a large company and I realized I was terrified of Git. Any time I had to do something that I deemed was complicated using Git, I thought I was going to destroy the repository or seriously mess something up.
In order to be able to work properly with my coworkers, I decided to learn Git very well. As I consumed online resources to learn Git, it became clear to me that most resources out there were very complex and not designed for people newly gaining technical skills.
Once I had understood the basics of Git quite well, a creative idea started to form in my mind for how I could teach this technology in a simpler way using visuals and colors.
I ended up creating an online course recording videos in my bedroom and uploaded it to the web. While making the online course, in the back of my mind, I thought to myself that someday I wanted to write a book as well.
I got a lot of positive feedback about the online course and finally in the summer of 2021 , I decided it was time to start writing a book to teach Git to beginners and anyone that wants to learn the basics of Git in a simple, visual, and tangible manner. The book youre reading now is the product of that decision and I hope it helps you on your Git learning journey.
Who This Book Is For
This book is for anyone that wants to learn the basics of how to use Git. It is especially designed for individuals that are newly gaining technical skills or individuals that work in non-technical roles but still need to use Git to collaborate with their technical counterparts. Some examples of individuals that may benefit from this book include but are not limited to: coding bootcamp students, computer science students, technical writers, product managers, designers, junior developers, data scientists, and self-taught programmers.
This book is written for people with no experience using Git as well as with a bit of experience using Git.
If you have no experience using Git, thats not a problem since this book starts from zero. We will go over the very first steps of working with Git such as installing it and how to use the command line and we will build from there.
If you have a bit of experience using Git or the command line, the first chapter may be a bit of revision. However, you should not skip it because it sets up the project that we will be using throughout the rest of the book.
Using This Book
This book is like a self-paced workshop. At the start of the book, you will be introduced to two Git projects - the rainbow project and the example book project.
The rainbow project is going to be the hand-on project we will work on throughout the entire book. In this project, we will list the colors of the rainbow as well as some colors not in the rainbow. In using Git to version control this project, we will learn the basics of how Git works.
This is not meant to be a realistic example of a project version controlled by Git. Instead it is meant to be a simplified project that will allow you to focus on learning the basics of Git rather than get bogged down in the details of building something complicated.
Since you will be working on the rainbow project throughout all the chapters of the book, you should read the book from Chapter to Chapter in a linear fashion and you should carry out each and every exercise in the book in order to follow along with the rainbow project on your computer and make the most of this learning experience.
In addition to the rainbow project, we will also introduce the example book project in order to provide a more realistic example of a project version controlled by Git.
The example book project will be about a book with ten chapters where each chapter represents a short story. We will not actively work on or build the example book project. It will only be used in order to provide more examples and descriptions of how certain features of Git are used in a more realistic project. This information will be contained in Example Book Project sections, such as the one displayed in Figure #-#.
Now, lets cover some other kinds of sections you will come across in the book.
Follow Along
Follow Along sections present a numbered list of actions that you should do in order to actively follow along on your computer. They usually involve creating and editing files in the text editor and executing commands in the command line. If youre not yet familiar with the command line, dont worry, in Chapter we introduce all the necessary basics. See Figure #-# for an example of what a Follow Along section looks like.