user name and email
git config --global user.name "user_name"
git config --global user.email "user_email"
可读性设置
git config --global color.ui auto
仓库初始化
git init
git status
git log
精简显示信息:git log --pretty=short
指定文件或目录的日志:git log filename/dir
文件改动:git log -p filename
图表形式显示分支:gitlog--graph
git reflog
git add filename
git commit -m “comment”
git push
git clone
git diff
git branch
git checkout -b
git checkout -b branchA
等同于
git branch branchA
git checkout branchA
git merge
git merge --no-ff branchname
git reset
git reset --hard hash_value(LOCAL REVERT)
git revert
git revert(REVERT LOCAL AND SERVER)
git rebase
git rebase goal_branch
git branch
git branch branch_name
git branch -f master HEAD~3(CURRENT BRANCH IS NOT MASTER)
git cherry-pick
git remote add
git remote add index_str repository_addr
设置repository为本地仓库的远程仓库
git push
#推送至master分支
git push -u index_str master
#推送至其他分支
git checkout branchname
git push -u index_str branchname
git clone
#默认克隆master分支到本地
git clone repository_addr
git pull
原文:https://www.cnblogs.com/movit/p/14757557.html