Skip to content

Instantly share code, notes, and snippets.

@matt-winzer
Last active February 1, 2018 22:39
Show Gist options
  • Save matt-winzer/cdbb3342c00c8ed6640647fb79f38564 to your computer and use it in GitHub Desktop.
Save matt-winzer/cdbb3342c00c8ed6640647fb79f38564 to your computer and use it in GitHub Desktop.

Basic Git Commands

Instructions

In this program, you will be following a git workfow for version control (tracking and saving changes you make to your files). There are a ton of git commands out there, but the most important ones for right now are below.

Get in the habit of using this workflow early and often, so you can rest easy knowing that if you make a mistake, you can always return to a previous commit and your project will be 'fixed'! We want you to try things, experiment, and sometimes that results in breaking stuff. But with git, you never need to worry that you have irrevocably broken anything 😄

Basic git workflow:

  1. Make changes to your files
  2. Add all your changes to git
  • git add -A
  1. Commit your changes (get them ready to send to github)
  • git commit -m "your-commit-message-here"
  1. Push your changes to github
  • git push origin master

NOTE

You can check the status of your local git 'situation' at any time

  • git status

I highly recommend using this command frequently, especially if you are unsure of where you are in your workflow

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