-
效果:
git.png
平常在公司用git提交代碼好幾行命令,敲都敲吐了,用sourceTree工具切換提交也點吐了.就隨手用fastlane寫了一個自動化腳本,在自己分支一鍵提交后將代碼合并到遠程倉庫再切回自己分支.
執(zhí)行:fastlane doit fr:xx to:xx m:'xxxx'
命令拆解:
fastlane:執(zhí)行fastlane命令
doit:自己命名的已編輯好由各個action組成的航道lane模塊命令(主體腳本)
fr:參數(from縮寫,從哪個分支)
to:參數(往哪個分支合并代碼)
m:參數(描述)示例:從自己dev分支往遠程master分支提交合并代碼,只需:fastlane doit fr:dev to:master m:’xxxx’
安裝fastlane:
1.確保安裝ruby:ruby -v
2.確保xcode-select安裝:xcode-select --install
3.安裝:sudo gem install fastlane
4.查看版本:fastlane --version如何使用自動化提交代碼腳本:
1.將腳本文件夾拖入到項目主目錄下
2.在.gitignore添加
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
Github地址:https://github.com/zhonghphuan/AutoCommit
本人博客:http://www.zhzao.com
