Skip to content

分支 ​


命令描述
git branch branch-name分支创建
git checkout branch-name分支切换
git checkout -b branch-name新建并切换分支
git branch -m new-name分支重命名
git merge branch-name合并分支
git branch -d branch-name删除分支
git push origin --delete branch-name删除远端分支
git branch查看本地分支
git branch -r查看远程分支
git branch --merged显示已经合并的分支
git branch --no-merged显示未合并的分支
git push -u origin branch-name推送
git reset --hard commitid
git push origin branchname --force
回滚
命令描述
git stash暂存文件
git stash list查看暂存
git stash apply [stash@{1}]恢复到某一次
git stash pop等价于:git stash apply + git stash drop