Skip to content

Instantly share code, notes, and snippets.

@BlakeJohnson117
Last active April 15, 2019 19:40
Show Gist options
  • Select an option

  • Save BlakeJohnson117/491bae49ebefde0b239eee09e9d01a7e to your computer and use it in GitHub Desktop.

Select an option

Save BlakeJohnson117/491bae49ebefde0b239eee09e9d01a7e to your computer and use it in GitHub Desktop.
Beginner's Guide to Git

Beginner's Guide to Git

Github Logo

Git Basic Commands

  1. add
  2. status
  3. diff
  4. commit
  5. reset
  6. rm

Example:

git add git status git diff git commit

Git Stages

  • Untracked
  • Unmodified
  • modified
  • staged

A file will start in the untracked stage until a user decides to use the command: git init. Git init will initialize the file and ensure that git is tracking. After initialization, the file will be moved to the staged stage. At this point the user will prepare to make their first intiial commit. Using the command:

git commit -m "Initial Commit"

will move the file from Staged to Unmodified . The file will remain in the unmodified stage until the user decides to edit the file. At this point the file will then move to the modified stage until the file is ready to be staged

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