git-flow:如何从原点签出发布分支?

发布于 2024-11-04 04:52:19 字数 415 浏览 2 评论 0 原文

使用 git-flow 从中央存储库中提取已发布发布分支的首选工作流程是什么?

例如:
Mike创建了一个发布分支,他通过“git flowreleasepublish1.0”发布了它
Jane 也想在该发布分支上工作,她如何从中央存储库中提取它以继续在该特定分支上使用 git flow?

  • 通过 git flow release start 1.0 然后通过 git pull 在本地创建分支?
  • 使用 git checkout -b release/1.0 origin/release/1.0 通过 git 在本地创建一个跟踪分支,并从那里继续(git flow 是否以这种方式在分支上工作?)

What is the perferred workflow to pull a published release branch from the central repo using git-flow?

eg:
Mike made a release branch, he published it through "git flow release publish 1.0"
Jane would like to work on that release branch too, how does she pull it from the central repo to continue working with git flow on that particular branch?

  • create the branch herself locally through git flow release start 1.0 and then git pull?
  • create a tracking branch locally through git with git checkout -b release/1.0 origin/release/1.0 and continue from there (does git flow work on the branch this way?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

香橙ぽ 2024-11-11 04:52:19

所需要做的就是设置一个本地跟踪分支,不需要 git-flow 特定命令。 Git-flow 显然只关心分支的名称以及它是否以“release/”字符串为前缀。

因此,设置一个本地跟踪分支(例如 gitbranch --trackrelease/1.5origin/release/1.5)就足够了。

All that is needed is setting up a local tracking branch, no git-flow specific commands are needed. Git-flow apparently only cares about the name of the branch and if it is prefixed with the "release/" string.

So setting up a local tracking branch like git branch --track release/1.5 origin/release/1.5 is all there is to it.

等往事风中吹 2024-11-11 04:52:19

git flow 版本(和功能)有一个“track”命令来简化您想要做的事情。要为已发布的分支设置本地跟踪分支并切换到该分支,只需执行以下操作:

git flow release track 1.0

或者

git flow feature track my-feature-branch

以下是来自 发布“track”命令的 gitflow 源

cmd_track() {
    parse_args "$@"
    require_version_arg

    # sanity checks
    require_clean_working_tree
    require_branch_absent "$BRANCH"
    git_do fetch -q "$ORIGIN"
    require_branch "$ORIGIN/$BRANCH"

    # create tracking branch
    git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH"

    echo
    echo "Summary of actions:"
    echo "- A new remote tracking branch '$BRANCH' was created"
    echo "- You are now on branch '$BRANCH'"
    echo
}

有用的 git flow 命令行参数

git flow release (and feature) have a "track" command to simplify what you're trying to do. To set up a local tracking branch for a branch that has already been published, and switch to it, just do this:

git flow release track 1.0

or

git flow feature track my-feature-branch

Here's the code excerpt from the gitflow source for the release "track" command:

cmd_track() {
    parse_args "$@"
    require_version_arg

    # sanity checks
    require_clean_working_tree
    require_branch_absent "$BRANCH"
    git_do fetch -q "$ORIGIN"
    require_branch "$ORIGIN/$BRANCH"

    # create tracking branch
    git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH"

    echo
    echo "Summary of actions:"
    echo "- A new remote tracking branch '$BRANCH' was created"
    echo "- You are now on branch '$BRANCH'"
    echo
}

Helpful git flow command line arguments

徒留西风 2024-11-11 04:52:19

一旦 git flowreleasepublish 完成,您可以执行以下操作:

git fetch -q “origin” “release1.0”
git branch –no-track “release1.0” FETCH_HEAD
git checkout -q “release1.0”

然后您可以开始拉取:

git pull “origin” “release1.0”

Once git flow release publish is done, you can do the following:

git fetch -q “origin” “release1.0”
git branch –no-track “release1.0” FETCH_HEAD
git checkout -q “release1.0”

And then you can start pulling:

git pull “origin” “release1.0”
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文