# 创建 develop 分支
git branch develop
# 将 develop 分支推送到远端仓库
git push -u origin develop
# 通过 develop 新建 feaeure 分支
git checkout -b Feature 分支名 develop
# 可选,将分支推送到远端仓库
git push -u origin Feature 分支名
# 查看状态
git status
# 添加提交内容
git add XXXfile
# 提交
git commit
# 切换到 develop 分支
git checkout develop
# 拉取远端仓库 develop 分支合并到本地 develop 分支
git pull origin develop
# 将 Feature 分支合并到 develop 分支
# --no-ff:不使用 fast-forward 方式合并,创建一个新的合并提交(merge commit)
# --squash:使用 squash 方式合并,指定分支的所有 commit 历史压缩为一个
git merge --no-ff Feature 分支名
# 将分支推送远端仓库
git push origin develop
# 删除 Feature 分支
# 创建 Release 分支并切换到 Release 分支上
git checkout -b release-0.1.0 develop
# 切换到 master 分支上
git checkout master
# 合并 release-0.1.0 分支
git merge --no-ff release-0.1.0
# 推送到远端仓库
git push
# 切换到 develop 分支上
git checkout develop
# 合并 release-0.1.0 分支
git merge --no-ff release-0.1.0
# 推送到远端仓库
git push
# 删除 release-0.1.0 分支
git branch -d release-0.1.0
# 创建 hotfix 分支并切换到 hotfix 分支上
git checkout -b hotfix-0.1.1 master
# 切换到 master 分支
git checkout master
# 合并 hotfix-0.1.1 分支
git merge --no-ff hotfix-0.1.1
# 推送到远端仓库
git push
# 切换到 develop 分支
git checkout develop
# 合并 hotfix-0.1.1 分支
git merge --no-ff hotfix-0.1.1
# 推送到远端仓库
git push
# 删除 release-0.1.0 分支
git branch -d hotfix-0.1.1
# 为主分支打上版本标签
git tag -a v0.1.1 master
# 将标签推送到远端仓库
git push --tags