- git config (--global, --local) (user.name, user.email) "Value"
- git config (--global, --local) (auto.crlf) (true, input)
- git config (--global, --local) (code.editor) "code --wait"
- git config (--global, --local) diff.tool vscode
- git config (--global, --local) difftool.vscode.cmd "code --diff --wait $LOCAL $REMOTE"
- git config (--global, --local) merge.tool p4merge
- git config (--global, --local) mergetool.p4merge.path "C://yourpath"
- git config (--global, --local) mergetool.keepBackup false
- git config (--global, --local) alias.graph "log --oneline --all --graph"
- git config (--global, --local) ff no || no fast-forward merge
- git init
- git status [-s]
- git add (filename, *.js, .)
- git rm filename [--cached]
- git mv oldname newName
- git ls-files
- git commit (-m, -am) "Commit message"
- git restore [--staged, --source=idCommit] (filename, *.js, .)
- git clean [-i, -n, -f]
- git log [filename.js, --oneline, --all, --graph, --stat, --patch, --author="name", --before="12-12-12", --after="10-10-10", --grep="Search title", -S"Search contents", --pretty="format:'%un %Cgreen %cd testing'"]
- git diff [--staged, --name-only, --name-status] (branchA branchB, commitA commitB)
- git show (idCommit, HEAD~2) [--name-only, --name-status]
- git bisect start -> git bisect good idCommit -> git bisect bad idCommit -> git bisect reset
- git shortlog [-n, -s, -e, --before="", --after=""]
- git checkout idCommit fileName || Restore deleted file
- git blame [-e, -L 1,4] filename.js
- git tag [-n, -d] -a v.1.0.0 -m "Description" or git tag v.1.0.0 idCommit
- git branch [-d, -D, --merged. --no-merged, -vv, -r] newBranch
- git stash push [-a, -m, -am] "Message Description" -> git stash list -> git stash show 1 -> git stash apply 1 -> git stash drop 1 or git stash clear
- git merge [--abort, --continue, --squash] {fast-forward, 3-way}
- git reset [--soft, --mixed, --hard] (idCommit, HEAD~1)
- git revert -m 1 HEAD
- git rebase [--continue, --skip, --abort] branchA
- git cherry-pick idCommit
- git clone www.github.com/username/repository.git [ foldername ]
- git remote [ -v ]
- git remote prune origin
- git fetch
- git pull [--rebase, ]
- git push [-d ] origin (branch, tag)