状态模型
- 工作区(workplace)
- 暂存区(index)
- 本地仓库(local repository)
- 远程仓库(remote repository)
仓库管理
git add .
git add fileName
- 暂存区(index)->本地仓库(local repository)
git commit -m '备注提交内容'
git clone xxxx地址 (不加分支默认master)
git clone git@gitee.com:xxxx/xxxxx.git
git clone -b xxxxx分支 xxxx地址 (不加分支默认master)
git clone -b dev git@gitee.com:xxxx/xxxxx.git
git status
git add .
git commit -m 'xxxx'
git pull
git push
日志查看
git log
git log --pretty=oneline
git log --pretty=oneline --abbrev-commit
git reflog
撤销和回退
git checkout xxx
git checkout .
git reset --hard HEAD
git reset --hard HEAD
git reset --hard HEAD^
分支管理
git brancn
git brancn -a
git checkout -b xxx分支名字
git branch xxx分支
git checkout xxx分支
git branch xxx分支
git checkout xxx分支
git branch -d
git branch -D
git push origin --delete dev_new
git push origin xxx分支名字
git pull origin xxx分支名字
git merge origin/xxx分支名字
git push