git init
git
git init [project-name]
url
git clone [url]
指针
git config --list
code
git config -e [--global]
orm
git config [--global] user.name "[name]"
git config [--global] user.email "[email address]"
排序
git add [file1] [file2] ...
rem
git add [dir]
it
git add .
form
git add -p
email
git rm [file1] [file2] ...
git rm --cached [file]
git mv [file-original] [file-renamed]
git commit -m [message]
git commit [file1] [file2] ... -m [message]
git commit -a
git commit -v
git commit --amend -m [message]
git commit --amend [file1] [file2] ...
git branch
git branch -r
git branch -a
git branch [branch-name]
git checkout -b [branch]
git branch [branch] [commit]
git branch --track [branch] [remote-branch]
git checkout [branch-name]
git checkout -
git branch --set-upstream [branch] [remote-branch]
git merge [branch]
git cherry-pick [commit]
git branch -d [branch-name]
git push origin --delete [branch-name]
git branch -dr [remote/branch]
git tag
git tag [tag]
git tag [tag] [commit]
git tag -d [tag]
git push origin :refs/tags/[tagName]
git show [tag]
git push [remote] [tag]
git push [remote] --tags
git checkout -b [branch] [tag]
git status
git log
git log --stat
git log -S [keyword]
git log [tag] HEAD --pretty=format:%s
git log [tag] HEAD --grep feature
git log --follow [file]
git whatchanged [file]### 显示指定文件相关的每一次diff
git log -p [file]### 显示过去5次提交
git log -5 --pretty --oneline### 显示全部提交过的用户,按提交次数排序
git shortlog -sn### 显示指定文件是什么人在什么时间修改过
git blame [file]### 显示暂存区和工做区的差别
git diff### 显示暂存区和上一个commit的差别
git diff --cached [file]### 显示工做区与当前分支最新commit之间的差别
git diff HEAD### 显示两次提交之间的差别
git diff [first-branch]...[second-branch]### 显示今天你写了多少行代码
git diff --shortstat "@{0 day ago}"### 显示某次提交的元数据和内容变化
git show [commit]### 显示某次提交发生变化的文件
git show --name-only [commit]### 显示某次提交时,某个文件的内容
git show [commit]:[filename]### 显示当前分支的最近几回提交
git reflog`
git checkout [file]
git checkout [commit] [file]
git checkout .
git reset [file]
git reset --hard
git reset [commit]
git reset --hard [commit]
git reset --keep [commit]
git revert [commit]
git stash
git stash pop
git archive