当你无法推送或拉取时的 Git 工作流程

发布于 2024-11-19 15:51:56 字数 1467 浏览 11 评论 0原文

这是重复出现的这是我的问题,但我想重申一下。

快速解释一下我的情况:我所处的环境中没有 git 服务器,也没有共享分区或编码人员之间的任何共同点。没有、不会有、不能有。时期。

我正在尝试提出一个工作流程解决方案,以便即使在我们管理的环境中也能保持我们的代表保持合理的同步。

我目前正在尝试的解决方案使用讨论组来分发补丁,有两个主要分支,工作流程看似很短,如下所示:

  • 分支是 marsteryours
  • < code>master 是同步分支,它将使您保持最新状态并跟踪其他开发人员仍然没有您的代码。
  • yours 将成为您的新主人,并且是您的最终代码所在的位置。您不在 master 中工作。
  • 每个人都将补丁发送到讨论列表。
  • 我认为非常很少有两个人会在同一个文件中工作。

工作流程中有两个主要操作:

生成补丁:

  1. 转到你的
  2. master生成补丁(git format-patch master< /code>)
  3. 转到 master
  4. yours 合并到 master
  5. > 转到 yours >,继续与您的合作

申请补丁:

  1. 转到 master 分支
  2. 应用收到的补丁
  3. 转到 yours 分支 将
  4. master 合并到 yours
  5. < strong>> 继续使用你的

如果我做对了,这应该使 master 分支与其他人保持合理的同步。

并不是说 yours 分支只是为了帮助跟踪其他人拥有或没有的东西。

有几个问题我想弄清楚是否会太麻烦:

  • 应用补丁的顺序?
  • 如何避免和检测有人错过了补丁?
  • 当有人错过补丁时会产生多大的问题?
  • 这可能会产生其他我没有想到的问题?

谢谢!

This is a recurring question for me, but I'd like to reiterate.

Quickly explain my situation: I am in an environment where I don't have a a git server, nor a shared partition or any common point among the coders. Don't have, will not have, can not have. Period.

I'm trying to come up with a workflow solution, to even in that environment we manage keep our reps at reasonable sync.

The solution I'm trying at the moment uses a discussion group to distribute patches, two main branches and with a seemingly short workflow, follows:

  • The branches are marster and yours
  • master is the sync branch, which will keep you up to date and track what other deves still don't have of your code.
  • yours will be your new master, and is where your final code should be. You do not work in master.
  • everybody sends patches to the discussion list.
  • I'm considering that very rarely two people will work in the same file.

There are two main actions in the workflow:

Generate patches:

  1. Got to yours
  2. Generate patches from master (git format-patch master)
  3. Go to master
  4. Merge yours into master
  5. > Go to yours, continue working with yours

Apply patches:

  1. Go to master branch
  2. Apply received patches
  3. Go to yours branch
  4. Merge master into yours
  5. > Continue working with yours

If I got it right, this should keep a master branch reasonably in sync with everyone else.

Not that the yours branch is only to help in keeping track of what other people have or not.

There are a few problems I'm trying to figure if will be too much hassle:

  • Order of patches applied?
  • How to avoid and detect when someone misses a patch?
  • How much problem can be when someone misses a patch?
  • Other problems this can generate I haven't even thought of?

Thanks!

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

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

发布评论

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

评论(1

恏ㄋ傷疤忘ㄋ疼 2024-11-26 15:51:56

我不想拥有一个具有两个分支的存储库,我宁愿拥有两个存储库:

  • 一个仅包含 master 分支,
  • 一个(从第一个分支克隆)包含 masteryours

这样我就可以:

  • 将我需要的内容从 yours 分支合并到“yours”存储库中的 master
  • 并从master 分支yours 存储库进入 master 存储库的 master 分支
  • 创建一个 来自 master 存储库的增量包(结果在一个文件中,更容易通信)
  • 通过邮件发送该一个文件,以及 master 存储库的 SHA1

在接收端,我会:

  • 从捆绑包中拉入 master存储库
  • 检查其 SHA1(这样,我确信我没有错过任何内容)
  • master 分支从 master 存储库拉入 master “你的”存储库的分支
  • 合并了我需要的内容master 分支到 yours 分支。

拥有两个单独的存储库的想法是拥有一个带有 SHA1 的存储库,可以在接收端检查该存储库:它在两个站点中必须完全相同。

Instead of having one repo with two branches, I would rather have two repo:

  • one with only master branch in it
  • one (cloned from the first) with master and yours

That way I can:

  • merge what I need from yours branch to master in the 'yours' repo
  • fetch changes from the master branch of the yours repo into the master branch of the master repo
  • Make a incremental bundle from the master repo (resulting in one file, easier to communicate)
  • mail that one file, along with the SHA1 of the master repo

On the receiving end, I would:

  • pull from the bundle into the master repo
  • check its SHA1 (that way, I am sure I didn't miss anything)
  • pull the master branch from the master repo into the master branch of the 'yours' repo
  • merge what I need from the master branch to the yours branch.

The idea of having two separate repo is to have one with a SHA1 which can be checked on the receiving end: it must be exactly the same in both sites.

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