How to I combine two separate Git repositories?

前端 未结 2 606
慢半拍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:36

    If you create a Git submodule:

    $ git submodule add git://github.com/tsgates/pylookup.git pylookup
    $ git submodule init pylookup
    $ git submodule update pylookup
    

    Let's say there are some changes to pylookup and you want to get them:

    $ cd pylookup
    $ git pull origin master
    $ cd ..
    $ git add pylookup
    $ git commit -m "Track new commit of pylookup"
    

提交回复
热议问题