在mac 中安裝跟使用git flow

工具git-flow是按照Vincent Driessen的branch 模型,實現的一個高層次(級別)的git倉庫操做擴展集合。git

mac 中安裝 git flow

使用Homebrew安裝

brew install git-flow
複製代碼

使用MacPorts安裝

port install git-flow
複製代碼

wget

wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash
複製代碼

curl

curl -L -O https://raw.github.com/nvie/gitflow/develop/contrib/gitflow-installer.sh
  sudo bash gitflow-installer.sh
複製代碼

mac中使用git flow

Git flow普通BUG流程:

# 進入克隆倉庫(上面有方法) clone
cd /git/woyaoquan
# 初始化版本流程控制
git checkout -b develop origin/develop
# 初始化工做目錄(一直回車便可)
git flow init 
# 開始建立新的需求分支,目的修改image
git flow feature start editimage #這時項目會自動切換 feature/editimage分支
# 更改部分代碼後
# git commit -a -m "修改完了"
# 完成開發分支合併develop(自動)
git flow feature finish editimage
# 發佈到遠程開發分支
git push origin develop

複製代碼

Git flow 緊急BUG流程(1):

# 拉回release版本
git pull origin release/v1.0
# 切換分支
git checkout release/v1.0
# 修改BUG
# git commit -a -m "修改完BUG,BUG文件+行數"
# 修改完後提交
git push origin release/v1.0

複製代碼

Git flow 緊急BUG流程(2):

# 切換到master分支
git checkout master
# 更新master分支
git pull origin master(更新master分支爲最新) 
#生成一個hotfix分支
git flow hotfix start hfx     

# 通知相關得工程師和測試人員hotfix分支名稱 
# 最終測試完成後拉回分支最新代碼
git pull origin hotfix/hfx
# 最終修改和測試完成後,結束hot fix以供發佈
git flow hotfix finish hfx
# 發佈最終的master分支
git push origin master

複製代碼
相關文章
相關標籤/搜索