- 配置用户签名:
git config [--global] user.name <用户名>
git config [--global] user.email <邮箱>
配置好后可通过cat ~/.gitconfig
指令查看。
git init
git status
git clone <远程仓库地址>
git clone <远程仓库的网址> <本地目录>
git clone <远程仓库的网址> -b <分支名称> <本地目录>
git add <文件名>
git add .
git add -u
git add --all
git add -A
git reset HEAD
git commit
git commit -m "<提交的描述信息>"
git commit --amend
git log
git reflog
git reset --hard <commit ID>
git branch
git branch <分支名>
git branch -m [<原分支名称>] <新的分支名称>
git branch -M [<原分支名称>] <新的分支名称>
git branch -d <分支名称>
git branch -D <分支名称>
git checkout <分支名称>
git checkout -b <分支名称>
git checkout --orphan <分支名称>
git merge <分支名称>