How to I combine two separate Git repositories?

前端 未结 2 605
慢半拍i
慢半拍i 2020-12-18 16:17

I have cloned a git repo which has my emacs config files in. I would like to add pylookup in a subdirectory. What is the correct way to do this?

Below are the optio

2条回答
  •  半阙折子戏
    2020-12-18 16:55

    I used subtree merge with a similar problem - http://git-scm.com/book/en/Git-Tools-Subtree-Merging. Something like:

    $ git remote add -f pylookup /path/to/pylookup
    $ git merge -s ours --no-commit pylookup/master
    $ git read-tree --prefix=pylookup/ -u pylookup/master
    $ git ci -m "merging pylookup into pylookup subdirectory"
    

    Good guide here: http://jasonkarns.com/blog/merge-two-git-repositories-into-one

提交回复
热议问题