我的个人github中有一个存储库,需要将其移至组织的存储库。我想在提交到组织中的新仓库时保留提交。我该怎么做?
答案 0 :(得分:0)
在组织中创建一个空的存储库,然后将其克隆。
在此仓库中,将您的github存储库添加为nex远程服务器:
git remote add githubrepo https://somewhere.on.github/project
然后抓取
git fetch githubrepo
然后将github母版推送到您的组织母版(假定位于源远程)
git push -f origin githubrepo/master:master # you probably need to force as you rewrite the history somehow
这是供master使用的,然后您可以将所需的任何分支推送到原始仓库