Git Submodule使用完整教程(小结)(4)
➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) git submodule init Submodule 'libs/lib1' (/home/henryyan/submd/repos/lib1.git) registered for path 'libs/lib1' Submodule 'libs/lib2' (/home/henryyan/submd/repos/lib2.git) registered for path 'libs/lib2' ➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) git submodule update Cloning into libs/lib1... done. Submodule path 'libs/lib1': checked out 'c22aff85be91eca442734dcb07115ffe526b13a1' Cloning into libs/lib2... done. Submodule path 'libs/lib2': checked out '7290dce0062bd77df1d83b27dd3fa3f25a836b54' 读者可以查看:.git/config文件的内容,最下面有submodule的注册信息! 验证一下类库的文件是否存在: ➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) cat libs/lib1/lib1-features libs/lib2/lib2-features I'm lib1. I'm lib2. 上面的两个命令(git submodule init & update)其实可以简化,后面会讲到! 2.3 修改Submodule 我们在开发人员B的项目上修改Submodule的内容。 先看一下当前Submodule的状态: (编辑:ASP站长网) |