隨著團(tuán)隊(duì)開發(fā)成員增多机久,引入了git-flow的使用,初次使用遇到一些問題
一:安利一篇優(yōu)質(zhì)的文章:
Git 在團(tuán)隊(duì)中的最佳實(shí)踐--如何正確使用Git Flow
二:簡單的使用過程枉疼,建立新功能即可開發(fā)
2.1 安裝git-flow:brew install git-flow
備注:如果沒有安裝brew皮假,復(fù)制下面代碼進(jìn)行安裝
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.2 安裝成功之后,點(diǎn)擊sourceTree->倉庫-> git-flow或 hg flow->建立新功能骂维,如下圖
屏幕快照 2018-04-09 下午8.18.42.png
三:使用過程中踩的坑
踩坑一:
問題描述:Fatal: Not a gitflow-enabled repo yet. Please run 'git flow init' first
WechatIMG2650.jpeg
解決方式:
錯(cuò)誤嘗試:首先嘗試根據(jù)提示惹资,在控制臺(tái)中,輸入“git flow init”航闺,失敗
正確解決方式親測可行:
這個(gè)方法是從stack flow上爬到的褪测,起初看到這個(gè)解決,無感也沒有嘗試潦刃,后來測試一波是可行的??
1侮措、Open the .git\config file
2、Remove all the [gitflow * entries and save the file
3乖杠、Close and re-open SourceTree
4分扎、In the main menu, go to Repository > Git Flow > Initialise Repository (should be enabled now)
1、打開本地項(xiàng)目 .git\config 文件
2胧洒、查找gitflow畏吓,然后刪除git flow相關(guān)內(nèi)容后保存
3、關(guān)閉.git\config 文件略荡,關(guān)閉soureTree
4庵佣、重新打開sourceTree,主菜單->倉庫-> git-flow或 hg flow->初始化倉庫汛兜,再重新建立新功能即可行
遇坑再續(xù)。通今。粥谬。