设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 数据 手机
当前位置: 首页 > 服务器 > 安全 > 正文

Git Submodule使用完整教程(小结)(14)

发布时间:2020-08-21 01:42 所属栏目:53 来源:网络整理
导读:henryyan@hy-hp ~/submd/ws/project1-b git:(master) git submodule +36ad12d40d8a41a4a88a64add27bd57cf56c9de2 libs/lib1 (heads/master)+7290dce0062bd77df1d83b27dd3fa3f25a836b54 libs/lib2 (heads/master)#

➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) ✗ git submodule +36ad12d40d8a41a4a88a64add27bd57cf56c9de2 libs/lib1 (heads/master) +7290dce0062bd77df1d83b27dd3fa3f25a836b54 libs/lib2 (heads/master) # 添加执行权限 ➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) ✗ chmod +x ./bin/update-submodules.sh ➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) ✗ ./bin/update-submodules.sh libs/lib1 Already on 'master' remote: Counting objects: 4, 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/lib1 36ad12d..8c666d8 master -> origin/master Updating 36ad12d..8c666d8 Fast-forward README | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 README libs/lib2 Switched to branch 'master' 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(-) ➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) ✗ git submodule 8c666d86531513dd1aebdf235f142adbac72c035 libs/lib1 (heads/master) e372b21dffa611802c282278ec916b5418acebc2 libs/lib2 (heads/master) ➜ henryyan@hy-hp ~/submd/ws/project1-b git:(master) ✗ git status # On branch master # Untracked files: # (use "git add <file>..." to include in what will be committed) # # bin/ nothing added to commit but untracked files present (use "git add" to track) </file>

更新之后的两个变化:

git submodule的结果和project2的submodule commit id保持一致;

project1-b不再提示new commits了。

现在可以把工具添加到仓库了,当然你可以很骄傲的分享给其他项目组的同事。

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读