Check out a workflow chart here: http://rogerdudler.github.io/git-guide/img/trees.png
git status - show what changes are ready to be committed as well as changes that you are working on in your working directory that haven’t been staged yet
git status
git add - mark a change to be staged
# in the directory of your repository
# add all
git add --all
# add specific file
git add myfile.txt
git commit - take a snapshot of your work
# in the directory of your repository
# don't forget the commit message
git commit -m 'commit message goes here'
git log - show commit history of your repository or file
# in the directory of your repository
git log
You can also colorize the output:
git log --color
git diff - show the line-by-line differences between your last commit and your working directory
# in the directory of your repository
# use --color for syntax highlighting
git diff --color
git reset - revert last commit… or unstage changes
# unstage changes
git reset filename.txt
# revert last commit
git reset HEAD^
git push - send your code to a remote repository
# push master branch to remote repository called origin
git push origin master