Source: Git Tutorial: A Comprehensive Guide
Snapshots
Local Operations
Track Changes
Loss of Data
States
git add
)git commit
)$ git status
$ git add filename (for a single file)
$ git add * (for all files in a repository)
$ git add . (for all files in a directory)
$ git commit -m "comments on change" (this commits the current file)
$ git commit -a (commits all changes made to tracked files)
$ git push origin master (will push to the master branch on repository on GitHub)
Stashing Changes
Used when you are not ready to commit changes, but do not want to lose them
$ git stash (temporarily removes changes and hides them, giving you a clean working directory)
$ git stash apply (retrieves hidden changes)
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
(this will make a local copy of your Git repository)