为什么使用Git Subtree.pdf
《为什么使用Git Subtree.pdf》由会员分享,可在线阅读,更多相关《为什么使用Git Subtree.pdf(10页珍藏版)》请在三一文库上搜索。
1、git subtree 分享 -cloudsben git submodule 允许其他的仓库指定一个commit嵌入仓库的子目录 git subtree 替代git submodule 命令, 合并子仓库到项目中并放在子目录 为什么要使用git subtree 管理和更新流程比较方便 git v1.5.2以后建议使用git subtree (git v1.7.11 才合并进来) 仓库 clone下来不需要 init 和 update 不会产生像 .gitmodule 类似的文件 git submodule 删除起来比较费劲 另外还有一些团队协作时的尴尬问题 使用 git subtree 会遇
2、到什么 你得学会git subtree新的合并方式和命令 给子仓库贡献代码有点繁琐 如何使用git subtree git subtree -h 极简方式 普通方式 二逼方式 极简方式 添加子仓库 git subtree add -prefi x=lib 仓库地 址 分支 -squash 更新 git subtree pull -prefi x=lib 仓库地址 分支 -squash 这种方式适用与只使用其他仓库代码,不push代 码方式 ,但是缺点就是命令有点长 普通方式 添加远程分支 git remote add -f 分支名 子仓库 git subtree add -prefi x=li
3、b2 远程分支 分支 -squash 更新仓库 git fetch 远程分支 分支 , git subtree pull - prefi x=lib2 远程分支 分支 -squash push 到子仓库代码 git subtree push -prefi x=lib2 sub2 master 二逼方式 首先解释为什么是二逼方式, 有git subtree 为什么不用 ? 添加远程分支 git remote add -f 分支名 子仓库 git merge -s ours -no-commit 远程分支/master (-s ours 表示只 fetch 其他远程分支头信息下来,但是不改变当前分支状态) git read-tree -prefi x=lib -u 远程分支/master git commit -m git pull -s subree 远程分支 master THANK YOU cloudsben
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 为什么使用Git Subtree 为什么 使用 Git
链接地址:https://www.31doc.com/p-3331950.html