How do you merge two Git repositories?

后端 未结 23 3857
耶瑟儿~
耶瑟儿~ 2020-11-21 05:45

Consider the following scenario:

I have developed a small experimental project A in its own Git repo. It has now matured, and I\'d like A to be part of larger projec

23条回答
  •  萌比男神i
    2020-11-21 06:11

    I wanted to move a small project to a subdirectory of a larger one. Since my small project did not have many commits, I used git format-patch --output-directory /path/to/patch-dir. Then on the larger project, I used git am --directory=dir/in/project /path/to/patch-dir/*.

    This feels way less scary and way more cleaner than a filter-branch. Granted, it may not be applicable to all cases.

提交回复
热议问题