global
git config --global user.name "your name"
git config --global user.email "your@email"
local
git config --local user.name "your name"
git config --local user.email "your@email"
global
git config --gobal --list
local
git ocnfig --local --list
git status
git init
git init <directory>
git clone <url>
single branch
git clone <url> --depth 1
git clone --depth 1 == git clone --depth 1 --single-branch
All branch
git clone <url> --depth 1 --no-single-branch
single
git add <file_name>
All
git add .
git remove added-file
git reset HEAD <file_name>
commit has been added
git commit -m "information"
open edit file and commit
git commit -a
edit last commit information
git commit --amend
git push
new branch for github
git push --set-upstream <url> <branch_name>
replace last commit (not recommend)
git push -f
Avoid replace other commit
git push --force-with-lease
git log
log GUI Graph
git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative
go current head
git reset --hard HEAD