Mercurial - 当个人提交时将父级更改合并到子叉中?
我的愿望是让我的分叉与父级保持同步,并且最好记录父级的个人提交和消息,以便我在分叉中拥有父级更改的完整历史记录。
因此,本质上,当您启动一个分叉并且将父级的整个提交历史记录视为您的分叉的“起点”时,我希望在分叉中保留父级的提交历史记录,并散布我的分叉特定的提交(存在冲突)分辨率根据需要)。
这可能吗?
或者,如果这是不可能的,有没有办法编写自动拉取和拉取的脚本?将父级更改合并到子分支中,同时将父级的提交消息合并到新合并的提交消息中? (因此来自导入提交的所有单独消息将被组合成一条巨大的合并消息)
My desire is to keep my fork up to date with the parent, and ideally record the parent's individual commits + messages, so that I have a full history in the fork, of what changed in the parent.
So essentially, when you start a fork and you see the parent's entire commit history as the "starting point" for your fork, I would like to keep the parent's commit history ongoing in the fork, with my fork-specific commits interspersed (with conflict resolution as needed).
Is this possible?
Or if that's not possible, is there a way to script an automatic pull & merge of parent changes into the child fork, while coalescing the parent's commit messages into the new merge's commit message? (so all individual messages from imported commits, would be combined into one massive merge message)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没记错的话,mercurial 和 git 在用于历史的数据结构方面有很多共享,并且至少在 git 中,合并可以满足您的要求。只需确保您的合并提交(或更改集,hg 称之为)实际上链接到两个父提交(最新的父项目提交和您的 fork 的最新提交),就是这样。
合并后,使用 hgk 等命令检查树。它应该看起来像:
http://wiki.genunix.org/wiki/images/3 /3f/Screenshot-hgk.png
If I am not mistaken, mercurial and git share a lot in terms of data structures used for history and, in git at least, merging does just what you ask for. Just make sure that your merge commit (or changeset, as hg calls it) actually links to both parent commit (the mostrecent parent project commit and your fork's most recent commit), and that's it.
After merging, check upon the tree with, for example, hgk. It should look like:
http://wiki.genunix.org/wiki/images/3/3f/Screenshot-hgk.png