git-subtree conflict when pulling from central repo

后端 未结 4 938
天涯浪人
天涯浪人 2021-01-17 10:21

I have several projects that depend on the same library, for which I\'d like to maintain a separate git repository to be managed with git-subtree within each project. So for

4条回答
  •  庸人自扰
    2021-01-17 10:49

    I actually found the proper way to do this through some trial and error.

    After this command:

    project1$  git subtree push --prefix=lib1 /path/to/lib1.git master
    

    execute a fetch command:

    project2$  git fetch /path/to/lib1.git master
    

    and then do your pull:

    project2$  git subtree pull --prefix=lib1 /path/to/lib1.git master
    

提交回复
热议问题