1、当生产要上线时需要把开发分支(dev为例)合并master
git checkout dev
git pull
git checkout master
git merge dev
git push -u origin master
2、当产品定义好之后需要从master 拉到dev
git checkout master
git pull
git checkout dev
git merge master
3、当git 冲突时候
git stash
git stash pop
4、新建分支和删除分支
git checkout -b dev 新建(然后在提交)
git branch -d dev 删除本地分支
git push origin --delete dev 删除远程分支
5、打tag
git tag 查看本地的所有Tag
git tag -a v1.0 -m "对Tag的描述信息" 创建tag命令
git push origin --tags 提交tag命令(远程)
git tag -d v1.0 删除tag命令
git push origin --delete tag v1.0 删除远程tag
6、多个钩子问题
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> proposal
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached proposal
hint:
hint: See "git help submodule" for more information.
解决方案:
rm -rf ./proposal/.git
7、待更新