从 github 到 bitbucket
想象一下这样的情况: 您在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
理想的解决方案包括保留本地 Mercurial 存储库,并且仅将此本地存储库用于现有的 bitbucket Mercurial 远程存储库。
使用插件像Hg-Git,你至少可以推送到并从 Mercurial 的 Git 服务器存储库中拉取,从而允许您从 GitHub 存储库拉取到本地 Mercurial 存储库。
从该本地 (Mercurial) 存储库,您可以照常使用 bitbucket 远程存储库。
OP 补充道:
这是有道理的,如果两个存储库都是单独开发的,则您无法将 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.
From that local (Mercurial) repo, you can then work as usual with the bitbucket remote repo.
The OP adds:
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: