2

我们使用 Mercurial 并设置了一个 repo 服务器,所有本地/开发人员更改都被推送到/从中提取。我从假期回来发现我们的一个回购已被替换。显然,开发人员在推送提交时遇到了问题,并认为唯一的解决方案是删除我们服务器上的 repo,并以新名称从他的机器上推送一个新的 repo。不知道怎么做,但在这样做的过程中,我们在项目被吹走之前丢失了项目的所有变更历史。

到目前为止,我的本地机器上仍然有完整的 repo 历史记录,并且希望将新 repo 与旧 repo 合并,并保留完整的更改历史记录。如果我丢失了历史记录,我会犹豫是否对我的机器进行拉取/更新。

我还想更新服务器上的 repo 目录的名称,因为现在我们的一些工具已经破坏了 repo 的路径,并且希望恢复到原始目录名称,而不是更新我们所有工具的引用。

我想我可以使用hg rename来做我想做的关于重命名的事情,但是如何将两个 repos 合并为一个呢?

4

1 回答 1

0

I found a way to merge by following (somewhat) the instructions here: https://www.mercurial-scm.org/wiki/MergingUnrelatedRepositories

  • First I made a copy of my local repo in case things went sideways
  • I cloned the repo on the server to the name I wanted it to be and which matched my local repo
  • I did a pull on the server repo to my local one and instead of doing an update, did a merge
  • Resolved merge diffs and committed locally
  • Pushed changes to new server repo, confirmed full change history was in place
  • Removed old server repo
于 2013-06-05T20:51:35.050 回答