开发者

From github to bitbucket

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开发者_Go百科 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.


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 github to bitbucket

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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜