我是git和git流的新手.我已经阅读了所有各种页面,博客和stackoverflow问题,并在我的日常开发中使用它.
但有一个问题一直困扰着我,我无法绕过它.我知道功能分支应该很小,你启动一个功能,编写它的一部分,然后完成功能.这是每天发生的事情,我明白了.我们只是确保我们的开发分支始终可构建.
但是当我处于一个功能的中间时会发生什么,它还没有准备好完成,但工作重点会改变吗?我希望能够切换到另一个功能.
例如,我开始一个新功能.
$ git flow feature start yak-Speedup
Run Code Online (Sandbox Code Playgroud)
我编写代码,提交文件等......并且正在取得良好进展.但是现在我需要改变我正在做的事情,主要是因为我需要一个不可用的资源,服务器编码器不会让它准备好一两天.我无法完成该功能,因为它将破坏开发分支.
我想做这样的事情:
$ git flow feature pause yak-Speedup
$ git flow feature start alpaca-Sheering
#write code
$ git flow feature finish alpaca-Sheering
$ git flow feature resume yak-Speedup
Run Code Online (Sandbox Code Playgroud)
实际上,"git flow feature list"命令的存在意味着我可以同时拥有多个功能.但我不知道如何在功能之间创建或切换.实际上,我开始认为这根本不是一个git flow问题,而是一个git问题.
我感谢任何帮助.谢谢!
Dan*_*ruz 48
您不需要该git flow feature pause yak-Speedup
命令(feature pause
无论如何都不存在).你想代替使用命令git flow feature resume yak-Speedup
IS git flow feature checkout yak-Speedup
; 这将使您回到yak-Speedup
功能分支继续开发.
执行git flow
显示:
Try 'git flow <subcommand> help' for details.
Run Code Online (Sandbox Code Playgroud)
并执行git flow feature help
显示:
usage: git flow feature [list] [-v]
git flow feature start [-F] <name> [<base>]
git flow feature finish [-rFk] <name|nameprefix>
git flow feature publish <name>
git flow feature track <name>
git flow feature diff [<name|nameprefix>]
git flow feature rebase [-i] [<name|nameprefix>]
git flow feature checkout [<name|nameprefix>]
git flow feature pull <remote> [<name>]
Run Code Online (Sandbox Code Playgroud)
聚会迟到了,但我的经验是这样的..我将 git 与 git flow 结合使用..
git flow feature start foo <<== start
#code, hack and COMMIT
git checkout develop <<== go back to develop branch..
git flow feature start foo2 <<== start a new feature
#code, hack and COMMIT
git checkout feature/foo <<== go back to foo. NB: using full branch name
Run Code Online (Sandbox Code Playgroud)
通过返回开发,我确保我独立于 foo 分支并仅使用开发。如果当时其他功能也有提交,我也可以对开发进行任何合并......
归档时间: |
|
查看次数: |
14416 次 |
最近记录: |