我在bitbucket上有空的存储库B,我想将另一个A分叉到我现有的存储库B.我怎么能这样做?在网站上bitbucket只允许在新的存储库中分叉。
答案 0 :(得分:2)
我看到两个选项:
如果您不需要Bitbucket将其称为分叉,您可以简单地克隆存储库A并将其推送到存储库B.这就是" fork"是
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
如果您需要Bitbucket将fork调用为fork,您可以利用Bitbucket wikis are repositories来创建wiki的本地副本,然后删除存储库B,然后将存储库A存储到存储库B,然后将维基推回存储库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