Skip to content

Instantly share code, notes, and snippets.

@andrewckinstler
Last active July 29, 2019 22:49
Show Gist options
  • Save andrewckinstler/8106ed485dce1ccc09fc4ceefd03270e to your computer and use it in GitHub Desktop.
Save andrewckinstler/8106ed485dce1ccc09fc4ceefd03270e to your computer and use it in GitHub Desktop.

Beginner's Guide to Git

So far...

My knowledge of Git is small at the moment, but much greater than it has ever been. I was always very overwhelmed by the concept, but am starting to truly appreciate what it has to offer.

I learned that in the past, companies would really only use verysion control if they had the means to afford it. That is because they had to have massive servers to store, not just the snapshots that we have now, which are really only recording changes, but entire websites worth of code. Many, many times.

Implementation

The basic pieces of code used in the terminal for Git are:

  • Initialize git init
  • Check the status of Git git status
  • Check the changes between committed files and what has to be committed git diff
  • Move files into the 'staging area' git add
  • Commit changes to live git commit

The basic workflow of Git is

  1. Initialize Git in the parent directory you're working in.
  2. Create the files you want Git to watch.
  3. Manipulate the contents of those files.
  4. Add those files to the 'staging area'.
  5. Commit those changes with a brief message saying what you did.

A sucessful commit looks like this

On branch master
nothing to commit, working tree clean

This diagram shows the Git work order:

diagram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment