从 github 到 bitbucket

发布于 2024-10-10 02:37:36 字数 299 浏览 0 评论 0原文

想象一下这样的情况: 您在 bitbucket 中有一个可用的存储库 - 您通过 TortioseHG 从 Windows 7 中的另一个 bitbucket 存储库中提取修订版本。

现在第二个项目已经转移到Github系统,你不能再从中拉取了。

所以我的问题是这样的: 我如何才能以某种方式在 bitbucket 中创建新的存储库,在那里我将从 github 中提取更改,并从这个存储库中我可以轻松地将 Tortiose HG 拉入我的工作存储库?

我不想使用 Github 等,所以请不要给我建议等,只是帮助我解决我的问题。谢谢。

Imagine situation like this:
You have a working repo in bitbucket - you were pulling revisions from another bitbucket repo in Windows 7 through TortioseHG.

Now the second project has moved to Github system and you can not pull from it anymore.

So my question is like this:
How can i somehow create new repo in bitbucket where I will pulling changes from github and from this repo i can easily pull in Tortiose HG to my working repo?

I do not want to use Github etc, so please do not advice it to me etc just help me with my question. Thank you.

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

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

发布评论

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

评论(1

匿名的好友 2024-10-17 02:37:36

理想的解决方案包括保留本地 Mercurial 存储库,并且仅将此本地存储库用于现有的 bitbucket Mercurial 远程存储库。

使用插件Hg-Git,你至少可以推送到并从 Mercurial 的 Git 服务器存储库中拉取,从而允许您从 GitHub 存储库拉取到本地 Mercurial 存储库。

alt text

从该本地 (Mercurial) 存储库,您可以照常使用 bitbucket 远程存储库。


OP 补充道:

它对我不起作用,所以我尝试将 git 存储库转移到 hg 存储库,并从这个存储库拉取到我的工作存储库并进行更改 - 但它说:中止:存储库不相关 -但我从中融合了很多。这里有什么帮助吗?

这是有道理的,如果两个存储库都是单独开发的,则您无法将 2 个(mercurial)存储库推/拉到另一个存储库中。
这在页面底部“了解 Mercurial”得到了确认,并详细说明在博客文章中:“什么 Mercurial不能做:子树存储库”。

更实用的解决方案是创建一个额外存储库(“父存储库”),并将两个存储库声明为嵌套存储库
它将使两个存储库保持独立,允许从第二个 Mercurial 存储库推回到 GitHub 存储库。

如果您不必返回 GitHub,但确实想要一个存储库来合并常见文件,那么您可以查看“将来自不相关存储库的提示与 Mercurial 合并”,但这要复杂得多。

我宁愿:

  • 将两个存储库分开,
  • 从第一个存储库中删除需要合并到第二个存储库中的公共文件。
  • 在第二个文件中报告并合并这些常见文件。

The ideal solution consiste to keep local Mercurial repo, and work only with this local repo to the existing bitbucket Mercurial remote repo.

With a plugin like Hg-Git, you can at least push to and pull from a Git server repository from Mercurial, allowing you to pull from the GitHub repo to your local Mercurial repo.

alt text

From that local (Mercurial) repo, you can then work as usual with the bitbucket remote repo.


The OP adds:

It didn't work for me so i tried to transfer git repo to hg repo and from this repo pull to my working repo with changes - but it says that: abort: repository is unrelated - but I merged a lot from it. Any help here?

That makes senses, if both repos have been developed separately, you cannot push/pull 2 (mercurial) repos one into another.
This is confirmed at the bottom of the page "Understanding Mercurial", and detailed in the blog post: "What Mercurial Can't Do: Subtree Repos".

The more practical solution would be to make one extra repository (a "parent one") with your two repos declared in it as nested repository.
It would keep both repos independent, allowing to push back to the GitHub repo from your second mercurial repo.

If you don't have to push back to GitHub, but really want to have one repo in which you merge common files, then you can look in "Merge tip from an unrelated repository with Mercurial", but that is much more complex.

I would rather:

  • keep both repos separate
  • delete from the first one the common files you need to merge in the second one.
  • report and merge those common files in the second one.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文