Commonly used commands

git status
git log
git log --one-line
 
git add .
git commit -am ""
 
git checkout some-branch
git checkout -b new-branch
git checkout -
git switch some-branch
 
git stash push
git stash pop
git stash list
git stash apply
git stash clear
 
git rebase target-branch
git rebase -i HEAD~X          # merge commit since X last commits
 
git reset --hard HEAD~        # hard reset last commit
git reset --hard ORIG_HEAD
 
git cherry-pick <commit>
 
git pull
git push
git push -u origin new-branch

Config

git config --global user.name XXX
git config --global user.email XXX
 
# for multiple git account
# in the git repo location
git config --local user.name XXX
git config --local user.email XXX
 
# get list of your config
git config --list
git config --origin