- git pull
- write code!
- git add <FILES>
- git commit -m "<MESSAGE>"
- do step 3&4 whenever you have finished adding a new feature
- git push origin master
- if there are merge conflicts, git pull
- fix conflicts and redo from step3
- working directory vs last added/committed changes (unstaged changes)
git diff -- <FILENAME>
- staged vs a commit
git diff --cached <COMMIT ID> -- <FILENAME>
if <COMMIT ID> is empty, the latest checkout-ed commit (HEAD) is used
- old commit vs new commit
git diff <COMMIT ID> <COMMIT ID> -- <FILENAME>
- if <FILENAME> is not provided, all changed files will be shown
- double dashes -- means end of cmd line flags