gpt4 book ai didi

git flow - 如何暂停一个功能的开发以处理另一个功能

转载 作者:IT王子 更新时间:2023-10-29 00:46:16 26 4
gpt4 key购买 nike

我是 git 和 git flow 的新手。我已经阅读了关于它的所有各种页面、博客和 stackoverflow 问题,并且一直在我的日常开发中使用它。

但是有一个问题一直困扰着我,我就是无法解决这个问题。我知道特性分支应该很小,你开始一个特性,对它的一部分进行编码,然后完成这个特性。这是每天都会发生的事情,我明白了。我们只是确保我们的开发分支始终是可构建的。

但是,当我正在开发一项功能时,它还没有准备好完成,但工作优先级发生了变化,会发生什么?我希望能够切换到另一个功能。

例如,我开始一项新功能。

$ git flow feature start yak-Speedup

我编写代码、提交文件等……并且在这方面取得了很好的进展。但现在我需要改变我正在做的事情,主要是因为我需要一个不可用的资源,而服务器编码器一两天内不会准备好它。我无法完成该功能,因为它会破坏开发分支。

我想做这样的事情:

$ 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

的确,“git flow feature list”命令的存在意味着我可以同时运行多个功能。但我看不到如何创建或切换功能。事实上,我开始认为这根本不是 git 流程问题,而是 git 问题。

我很感激任何帮助。谢谢!

最佳答案

您不需要 git flow feature pause yak-Speedup 命令(feature pause 根本不存在)。您要用来代替 git flow feature resume yak-Speedup 的命令是 git flow feature checkout yak-Speedup;这将使您回到 yak-Speedup 功能分支以继续开发。

执行 git flow 显示:

Try 'git flow <subcommand> help' for details.

并执行 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>]

关于git flow - 如何暂停一个功能的开发以处理另一个功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8581609/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com