在mac中使用gitflow

简介

工具git-flow是按照Vincent Driessen的branch 模型,实现的一个高层次(级别)的git仓库操作扩展集合。

mac中安装

  1. 使用Homebrew安装
    brew install git-flow
  2. 使用MacPorts安装
    port install git-flow
  3. wget
    wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash
  4. curl
curl -L -O https://raw.github.com/nvie/gitflow/develop/contrib/gitflow-installer.sh
sudo bash gitflow-installer.sh

git-flow的branch模型

  • master分支:
    总是发布稳定版本, 这反应了软件的最新/最稳定的状态

  • develop 分支:
    用于集成已完成的特性
    用于集成来自针对master分支的hostfix
    CIServer需要真对此分支进行日构建/运行测试/

  • 临时分支:
    多人开发时可能需要在远程临时共享某些分支

使用

init

使用init命令来初始化一个新的repo,同时包括基本的branch结构。选项-d会接受所有的缺省值。

git flow init [-d]

创建feature/release/hotfix/support分支

  • 列出、开始、结束feature 分支

    git flow feature
    
    git flow feature start <name> [<base>]
    
    #对feature分支,<base>参数必须是在develop上的提交
    
    
    git flow feature finish <name>
  • push/pull feature分支

    git flow feature publish <name>
    git flow feature pull <remote> <name>
  • 列出、start/finish release分支

    git flow release
    
    git flow release start <release> [<base>]
    
    # base 参数必须是develop分支的一个提交。
    
    
    git flow release finish <release>
    
  • 列出、start/finish hotfix分支
git flow hotfix
git flow hotfix start <release> [<base>]
git flow hotfix finish <release>
  • 列出、start/finish support分支
git flow support
git flow support start <release> <base>
# 对support分支,<base>必须是master的一个提交。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值