# father-git-subtree **Repository Path**: calldream/father-git-subtree ## Basic Information - **Project Name**: father-git-subtree - **Description**: 测试 git tree 命令 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-26 - **Last Updated**: 2022-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # father-git-tree #### 介绍 测试 git subtree 命令 git subtree 对于组内其他人员来说,是非常无感的。完全不需要知道 git subtree 这个命令。子系统的里边的内容,也可以随便、正常的commit [非官方文档](https://www.jianshu.com/p/d42d330bfead) #### 关联子系统 cd 项目B git remote add libraryc git@192.168.1.123:rep/libraryC.git //添加源 git subtree add --prefix LibraryC libraryc master //后三个参数分别是:目录、源名称、分支名 git subtree pull --prefix LibraryC libraryc master --squash //更新代码 --squash 只拉最新提交 git subtree push --prefix LibraryC libraryc master //提交代码 #### 细节说明 经测试,subtree 内容可以当作普通文件一样修改,可以和外部文件一起修改。 git subtree push 不可以简化,最多就是把远端地址保存一下而已。 git subtree push 会把当前项目中有关于subtree 的内容正常推送到子仓库 1. 会过滤掉无关提交 2. 和外部文件一同修改时,不会把外部文件一起推送到子仓库