How to copy commits from one Git repo to another?

前端 未结 5 1785
渐次进展
渐次进展 2020-11-28 19:24

Last week I created a Github repo and forgot to select a license for the repo. Now there are already 3 large commits.

I have asked the 3 contributors if it is ok, if

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 19:41

    I used the following approach:

    • Clone the source repo to a folder like /c/SrcRepo

    • Clone the destination repo to a folder like /c/DstRepo and switch to the destination branch

    • In the root folder of the destination repo run the command:

      git pull /c/SrcRepo srcBranch --allow-unrelated-histories

    No necessary to create an additional remote reference

提交回复
热议问题