mkdir repo cd repo git init touch README git add README git commit -m "first commit" git remote add origin git@server:path/repo.git git push -u origin master
Local: git checkout -b <branch>
Remote:
git checkout -b <branch>
git push origin <branch>
Local: git branch -d <branch>
Remote: git push origin --delete <branch>
git fetch origin git diff --name-status master origin/master
Add modified files in the stash: git stash
List stash: git stash list
Add stash files in current branch: git stash apply
Clean stash: git stash clear
Reset HEAD: git reset --hard
Reset commit: git reset --hard <commit hash>
Commit list: git reflog
Checkout file from head: git checkout -- filename
Checkout file from commit: git checkout <commit hash> filename
Ignore: git update-index --assume-unchanged <file>
Start tracking: git update-index --no-assume-unchanged <file>