Git Submodule使用完整教程(小结)
➜ henryyan@hy-hp ~/submd/ws/project1 git:(master) ✗ cd libs/lib2 ➜ henryyan@hy-hp ~/submd/ws/project1/libs/lib2 git:(master) git pull remote: Counting objects: 5, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From /home/henryyan/submd/repos/lib2 7290dce..e372b21 master -> origin/master Updating 7290dce..e372b21 Fast-forward lib2-features | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 2.7.2 更新project1的submodule引用 在2.7.1中我们更新了project1的lib1和lib2的最新版本,现在要把最新的commit id保存到project1中以保持最新的引用。 ➜ henryyan@hy-hp ~/submd/ws/project1 git:(master) ✗ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: libs/lib1 (new commits) # modified: libs/lib2 (new commits) # no changes added to commit (use "git add" and/or "git commit -a") ➜ henryyan@hy-hp ~/submd/ws/project1 git:(master) ✗ git commit -a -m "update lib1 and lib2 commit id to new version" [master 8fcca50] update lib1 and lib2 commit id to new version 2 files changed, 2 insertions(+), 2 deletions(-) ➜ henryyan@hy-hp ~/submd/ws/project1 git:(master) git push Counting objects: 5, done. Delta compression using up to 2 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 397 bytes, done. Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. To /home/henryyan/submd/ws/../repos/project1.git c96838a..8fcca50 master -> master </file></file> 2.8 更新project1-b项目的子模块(使用脚本) (编辑:衢州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |