美文网首页
Git Flow 简短手记

Git Flow 简短手记

作者: empty98 | 来源:发表于2018-01-05 13:03 被阅读0次
    1. 开始新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

    2. 完成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

    1. 开始Relase
      git checkout -b release-0.1.0 develop

    // Optional: Bump version number, commit
    // Prepare release, commit

    1. 完成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

    1. 开始Hotfix,用于修复线上BUG
      git checkout -b hotfix-0.1.1 master

    2. 完成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

    相关文章

      网友评论

          本文标题:Git Flow 简短手记

          本文链接:https://www.haomeiwen.com/subject/xbojnxtx.html