我在Bitbucket上有一个空的仓库B,想将另一个仓库A fork到我现有的仓库B中。我该如何操作?在Bitbucket网站上只允许fork到新的仓库。
我在Bitbucket上有一个空的仓库B,想将另一个仓库A fork到我现有的仓库B中。我该如何操作?在Bitbucket网站上只允许fork到新的仓库。
If you don't need Bitbucket to call it a fork you can simply clone repository A and push it to repository B. This is most of what a "fork" is.
git clone git@bitbucket.com:user/repo
cd repo
git remote add my-clone git@bitbucket.com:you/repo-b
git push --mirror my-clone
If you need Bitbucket to call your fork a fork, you can take advantage of the fact that Bitbucket wikis are repositories to make a local copy of your wiki, then delete repository B, then fork repository A to repository B, then push the wiki back to repository B.
git clone http://bitbucket.org/you/repo-b/wiki repo-b.wiki
cd repo-b.wiki
# Have a look at the files in repo-b.wiki and make sure they look complete
# Then delete repository B from Bitbucket
# Then fork repository A to repsitory B using the Bitbucket web UI
# Then push the wiki back:
git push origin master