Commit messages
<chore, docs, feat, fix, refactor, style, or test>: <Summary in present tense>
Add a folder to git
https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Flight rules for git
https://github.com/k88hudson/git-flight-rules
Apply .gitignore to current branch
git rm -r --cached .
git add .
git commit -m ".gitignore existing files"
Hard reset
git fetch --all
git reset --hard origin/master
Discard local changes
git checkout .
Discard changes but keep them for later use
Save changes in a stack: git stash You can apply the changes to your working copy later using: git stash pop Save those changes to the file changes.patch: git diff > changes.patch If you want to apply them to your working copy you can do so: git apply changes.patch.
New & empty branch in Git
$ git checkout --orphan NEWBRANCH
# Unstage all the files in your working tree.git rm --cached $(git ls-files)$ git rm -rf .
git push origin NEWBRANCH
Feature branch
git checkout -b NEWBRANCH
[Do stuff]
git push origin NEWBRANCH