Git Basic Reference

The git tool allows developers to track their changes to application code over time. This is especially valuable for recovering a working version of an application if something goes wrong. While git includes many advanced features for team collaboration and parallel feature development, this guide will focus on the basics - those commands that are most useful to a solo developer.

After reviewing the terminology specific to git and an introduction to GitHub, you will find these commands:

Process

The basic git process looks something like this...

  1. Start work on one, two, or a few code files.
  2. Collect the files that you want to back up together. In git terms, this is referred to as "preparing a commit". It involves adding new and modified files into the collection.
  3. Lock in this set of changes by "committing" them.

All of these steps happen on your local machine - no one else can see them.

To share files with others, or store them remotely, so you can recover them even if your machine becomes unusable, you need to "push" to a server. If you are collaborating or using code shared by other developers, then you'll need to "pull" changes from the remote server to your local machine.

Terminology

In order to most effectively use git, there are a few terms you need to understand.

You'll learn more about additional terms (such as branch, log, staging area, working directory, and more).