git remote prune origin 同步远程被删除的分支
使用git
命令可以直接添加Submodule
:
git submodule add [email protected]:jjz/pod-library.git pod-library
使用git status
命令可以看到
git status
On branch master Changes to be committed: new file: .gitmodules new file: pod-library
可以看到多了两个需要提交的文件:.gitmodules和 pod-library
.gitmodules 内容包含Submodule的主要信息,指定reposirory,指定路径:
[submodule "pod-library"] path = pod-library url = [email protected]:jjz/pod-library.git
可以看到记录了子项目的目录和子项目的git地址信息。
pod-libray内容只保护子项目的commit id,就能指定到对于的git header上,例如: