基于团队的 Git 工作流程

发布于 2024-12-11 10:07:45 字数 637 浏览 0 评论 0原文

我最近设置了一个 Gitolite Ubuntu 服务器,以及存储库和用户(组内)。一切都进展顺利,真正有效。

在我的 Git 研究中,我发现了一个特定的 Git 模型按照我们想要的方式工作。我们迫切需要一种方法来将修补程序应用于当前的源代码,而不破坏当前的开发版本。 “nvie”的这个模型可以满足我们的所有需求。

问题是它并没有真正解释使用此模型的远程托管。我们无法弄清楚一些事情。

目前,我们认为每次添加完成的新 feature-* 分支时,我们都会将其推送到同名的远程分支。但这意味着我们中的一个人稍后必须手动拉取它们并确保不存在冲突。

我们如何在基于团队的工作流程中使用“nvie”模型?

编辑得更清楚:

团队中没有一个人理解两个人如何开发自己的功能。第一个人完成他们的功能并合并到 develop 中。第二个人做什么?存储他们的更改并将 develop 拉到他们的分支中,然后应用他们的存储或什么?

我们不确定如何同时推进开发等,而不覆盖彼此的新更改。

I've recently setup a Gitolite Ubuntu server, along with repositories and users (within groups). Everything is going swimmingly for things actually working.

In my Git research, I've found a specific Git Model that works in the way we want it to. We were in dire need for a way to apply hotfixes to our current source without screwing the current development version. This model from "nvie" attends to all of our needs.

The problem is that it doesn't really explain remote hosting using this model. And we can't figure out a few things.

Currently we're thinking that every time we add a new feature-* branch which is finished, we'll push it to a remote branch under the same name. But this means that one of us will then at a later date have to have to manually pull them and ensure there are no conflicts.

How can we use the "nvie" model but in a team based workflow?

Edit to be more clear:

None of the team understand how, say, two people can be developing their own features. The first person finishes their feature and merges into develop. What does the second person do? Stash their changes and pull down develop into their branch, then apply their stash or what?

We're unsure how we can be pushing into develop at the same time etc, without overwriting each others newer changes.

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

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

发布评论

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

评论(3

二货你真萌 2024-12-18 10:07:45

这是一个争论很大的话题。 Git 等现代工具使按功能分支成为可能。以前,人们对此不以为然,因为粒度级别不可能达到——或者说太难做到。

我将探索添加一个分支,您可以根据集成后可能未获得 QA 批准的情况重置该分支 - UAC。这对我和其他人来说效果很好。这是对其的非常详细的描述以及之后的良好讨论。我希望它对您有所帮助:

https://plus.google.com/109096274754593704906/posts/R4qkeyRadLR

This is a huge topic of contention. Branch-per-feature is made possible by modern tooling like Git. Before, it was frowned upon as the level of granularity was not possible - or it was too difficult to do.

I would explore adding a branch that you can reset based upon potentially not getting QA approval - UAC after integrating. This has worked well for me and others. Here is a very detailed account of it and a good discussion after. I hope it helps:

https://plus.google.com/109096274754593704906/posts/R4qkeyRadLR

紫南 2024-12-18 10:07:45

引自主题

特征分支的本质是,只要
功能正在开发中,但最终会被合并回
开发(明确将新功能添加到即将发布的版本中)或
被丢弃(如果实验令人失望)。

功能分支通常仅存在于开发人员存储库中,而不存在于
起源。

必须让所有水晶都干净。后面的代码显示相同的风格

完成的功能可能会合并到开发分支中,绝对添加
他们即将发布的版本:

$ git checkout develop
Switched to branch 'develop'
$ git merge --no-ff myfeature
Updating ea1b82a..05e9557
(Summary of changes)
$ git branch -d myfeature
Deleted branch myfeature (was 05e9557).
$ git push origin develop

注意推送分支,开发,而不是功能分支。您只需根据需要进行尽可能多的合并|推送

Quote from topic

The essence of a feature branch is that it exists as long as the
feature is in development, but will eventually be merged back into
develop (to definitely add the new feature to the upcoming release) or
discarded (in case of a disappointing experiment).

Feature branches typically exist in developer repos only, not in
origin.

must make all crystal clean. Later code show the same style

Finished features may be merged into the develop branch definitely add
them to the upcoming release:

$ git checkout develop
Switched to branch 'develop'
$ git merge --no-ff myfeature
Updating ea1b82a..05e9557
(Summary of changes)
$ git branch -d myfeature
Deleted branch myfeature (was 05e9557).
$ git push origin develop

Note pushed branch, develop, not feature-branch. You just make as much merge|push, as it needed

無心 2024-12-18 10:07:45

Atlassian 网站上的这个快速教程将是一个很好的开始。

https://www.atlassian.com/git/workflows

This quick tutorial on atlassian website will be a great start.

https://www.atlassian.com/git/workflows

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