廖一峰的 Git 教程html
git log
git log -p <filename>
git log --stat --author=someone
git show <commit-hash-id>
git log -p -2
git diff
git diff --staged
git diff HEAD
即对撤销使用过
git add
命令的文件,撤销其git add
操做git
git reset HEAD test.html
git log --pretty=oneline
能够查看更为清晰的log
windows
HEAD
表示当前版本,HEAD^
表示上一个版本,HEAD^^
表示上上一个版本,再往上 100 个版本则用HEAD~100
表示bash
Git容许咱们在版本的历史之间穿梭,使用命令 git reset --hard commit_id
。code
穿梭前,用 git log
能够查看提交历史,以便肯定要回退到哪一个版本。htm
要重返将来,用 git reflog
查看命令历史,以便肯定要回到将来的哪一个版本。教程
git clone -b <branch name> [remote repository address]
git config --global user.name "your name" git config --global user.email "your email"
git config user.name git config user.email
或者rem
git config --global -l
在 .gitconfig
文件里面会有你先前配好的 name
和email
,只需添加下面代码便可get
[credential] helper = store
.gitconfig
文件路径:hash
windows 系统默认状况:
C:\Users\Administrator
目录Linux系统:~/.gitconfig
list
能够简写为l
git config --global --list
git config --local -l
git config --global -l
git config --system -l
积累、整理中...