git 查看所有分支
git branch -a
git查看当前所在分支
git status
On branch <BranchName>
git 新建分支
git branch <BranchName>
git 删除本地分支
git branch -d <BranchName>
git 删除远程分支
git push origin delete <BranchName>
git 合并分支
git merge <BranchName>
git 日志查看
git log
git 回滚
git reflog
git reset --hard commit-id //回滚到commit-id,讲commit-id之后提交的commit都去除
git reset --hard HEAD~3 //将最近3次的提交回滚
git退出log日志
q
git 切换分支
git checkout <BranchName>
git 拉去某个远程分支
git checkout -b localdev origin dev
克隆指定分支代码
git clone -b master http://gitslab.yiqing.com/declare/about.git
将部分修改功能复制到其他分支
git cherry-pick <commithash>
//多个修改hash
git cherry-pick <commithash>..<commithash>
git cherry-pick <commithash>^..<commithash>
//或者
git commit -c <commithash>//这里是有冲突时的提交方式
合并提交信息
将多次提交信息合并成一次
git rebase -i <start Head><end Head>
git rebase -i Head~3//最近三次commit、合并
将选中的commit片段合并到指定分支代
git rebase <start Head> <end Head> --onto branchname
修改最近一次commit信息
git commit --amend
4451

被折叠的 条评论
为什么被折叠?



