当你无法推送或拉取时的 Git 工作流程
这是重复出现的这是我的问题,但我想重申一下。
快速解释一下我的情况:我所处的环境中没有 git 服务器,也没有共享分区或编码人员之间的任何共同点。没有、不会有、不能有。时期。
我正在尝试提出一个工作流程解决方案,以便即使在我们管理的环境中也能保持我们的代表保持合理的同步。
我目前正在尝试的解决方案使用讨论组来分发补丁,有两个主要分支,工作流程看似很短,如下所示:
- 分支是
marster
和yours
- < code>master 是同步分支,它将使您保持最新状态并跟踪其他开发人员仍然没有您的代码。
yours
将成为您的新主人,并且是您的最终代码所在的位置。您不在master
中工作。- 每个人都将补丁发送到讨论列表。
- 我认为非常很少有两个人会在同一个文件中工作。
工作流程中有两个主要操作:
生成补丁:
- 转到
你的
- 从
master
生成补丁(git format-patch master< /code>)
- 转到
master
- 将
yours
合并到master
- > 转到
yours
>,继续与您的
合作
申请补丁:
- 转到
master
分支 - 应用收到的补丁
- 转到
yours
分支 将 master
合并到yours
- < 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
andyours
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 inmaster
.- 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:
- Got to
yours
- Generate patches from
master
(git format-patch master
) - Go to
master
- Merge
yours
intomaster
- > Go to
yours
, continue working withyours
Apply patches:
- Go to
master
branch - Apply received patches
- Go to
yours
branch - Merge
master
intoyours
- > 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不想拥有一个具有两个分支的存储库,我宁愿拥有两个存储库:
master
分支,master
和yours
这样我就可以:
yours
分支合并到“yours
”存储库中的master
,master
分支yours
存储库进入master
存储库的master
分支master
存储库的增量包(结果在一个文件中,更容易通信)master
存储库的 SHA1在接收端,我会:
master
存储库master
分支从master
存储库拉入master
“你的”存储库的分支master
分支到yours
分支。拥有两个单独的存储库的想法是拥有一个带有 SHA1 的存储库,可以在接收端检查该存储库:它在两个站点中必须完全相同。
Instead of having one repo with two branches, I would rather have two repo:
master
branch in itmaster
andyours
That way I can:
yours
branch tomaster
in the 'yours
' repomaster
branch of theyours
repo into themaster
branch of themaster
repomaster
repo (resulting in one file, easier to communicate)master
repoOn the receiving end, I would:
master
repomaster
branch from themaster
repo into themaster
branch of the 'yours' repomaster
branch to theyours
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.