Skip to content

Instantly share code, notes, and snippets.

@trieb
Last active May 29, 2017 09:14
Show Gist options
  • Save trieb/66f927b2b033ca79a6f72bec905fed0d to your computer and use it in GitHub Desktop.
Save trieb/66f927b2b033ca79a6f72bec905fed0d to your computer and use it in GitHub Desktop.
Git basics

Create new file, commit and push to GitHub

  1. Add new file file.php
  2. Add some text to file and save.
  3. Stage file to git $ git add file.php
  4. Commit file and add message $ git commit -m "Added new file to repo."
  5. Push file to GitHub $ git push origin

Workflow

  1. $ git st // To check which files have been changed
  2. $ git diff file.php // To check diff
  3. $ git add file.php // Stage file before commiting
  4. $ git commit -m "My message" // Commit file (5. $ git push origin // Push to GitHub)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment