创建版本
git clone
git init #初始化本地版本库
修改和提交
git status #查看状态
git diff #查看变更内容
git add . #跟踪所有改动过的文件
git add
git mv
git rm
git rm —cached
git commit -m ‘’ #提交文件
git commit -m ‘’ —no-verify #提交文件不进行eslint检测
git commit —amend #修改最后一次提交
查看提交历史
git log #查看提交历史
git log -p
git blame
撤销
git reset -hard HEAD #撤销工作目录所有未提交的修改
git checkout HEAD
git rever
分支与标签
git branch #显示所有本地分支
git checkout
git branch
git branch -d
git tag #列出本地tag
git tag
git tag -d
合并与衍合
git merge
git rebase
远程操作
git remote -v #查看远程版本库信息
git remote show
git remote add
git fetch
git pull
git push
git push
git push —tags #上传所以tag