查看所有分支: git branch
切换分支: git checkout ‘分支名称’
工作目录和暂存区状态: git status
克隆项目: git clone ‘项目链接’
提交
提交到暂缓区: git add .
提交到本地仓库: git commit -m ‘描述’
git add .
和 git commit -m ‘提交描述’
组合使用:
git commit -a -m ‘提交描述’ 或者 git commit -am ‘提交描述’
推代码到线上仓库:git push
撤销提交
git add 之后撤销
git reset HEAD 撤销所有
git reset HEAD ../../file 撤销指定文件
git commit 之后撤销
git log 查看commit_id
git reset commit_id
合并分支
1、切换到当前分支git checkout master
2、合并分支git merge 分支名称
3、提交代码git push
or
取回远程分支代码与本地指定分支合并: git pull origin 指定分支
待更。。。