开始新Feature开发,有新功能开发时
git checkout -b some-feature develop
// Optionally, push branch to origin:
git push -u origin some-feature
// 做一些改动
git status
git add some-file
git commit完成Feature
git pull origin develop
git checkout develop
git merge --no-ff some-feature
git push origin develop
git branch -d some-feature
// If you pushed branch to origin:
git push origin --delete some-feature
- 开始Relase
git checkout -b release-0.1.0 develop
// Optional: Bump version number, commit
// Prepare release, commit
- 完成Release
git checkout master
git merge --no-ff release-0.1.0
git push
git checkout develop
git merge --no-ff release-0.1.0
git push
git branch -d release-0.1.0
// If you pushed branch to origin:
git push origin --delete release-0.1.0
git tag -a v0.1.0 master
git push --tags
开始Hotfix,用于修复线上BUG
git checkout -b hotfix-0.1.1 master完成Hotfix
git checkout master
git merge --no-ff hotfix-0.1.1
git push
git checkout develop
git merge --no-ff hotfix-0.1.1
git push
git branch -d hotfix-0.1.1
git tag -a v0.1.1 master
git push --tags
拉取远程分支并创建本地分支
git fetch origin 远程分支名x:本地分支名x