0%

git分支管理

创建新功能分支

1
git checkout -b feature-unit-test dev

创建fixbug分支

1
git checkout -b hotfix-1.2.1 master

当开发新功能或修复bug合并分支需要用”–no-ff”

1
git merge --no-ff hotfix-1.2.1

删除分支

1
git branch -d feature-x

删除远程分支

1
git push origin -d feature-wxpay

当展示离开当前分支的时候临时缓存代码,避免合并到其它分支

1
2
3
4
//暂时缓存代码
git stash
//从缓存中恢复代码
git stash pop