相关疑难解决方法(0)

使用git-subtree添加远程仓库的子目录

有没有办法使用git-subtree将远程存储库的子目录添加到我的存储库的子目录中?

假设我有这个存储库:

/
    dir1
    dir2
Run Code Online (Sandbox Code Playgroud)

而这个存储库:

/
    libdir
        some-file
    some-file-to-be-ignored
Run Code Online (Sandbox Code Playgroud)

我想将library/libdir导入main/dir1,使它看起来像这样:

/
    dir1
        some-file
    dir2
Run Code Online (Sandbox Code Playgroud)

使用git-subtree,我可以指定使用参数导入dir1--prefix,但是我是否还可以指定仅获取子树中特定目录的内容?

使用git-subtree的原因是我以后可以同步这两个存储库.

git git-subtree

38
推荐指数
1
解决办法
1万
查看次数

标签 统计

git ×1

git-subtree ×1