【发布时间】:2012-03-25 17:38:28
【问题描述】:
我一直在使用 git 子树扩展 (https://github.com/apenwarr/git-subtree) 。 我使用“--squash”来清理主项目的日志,我的步骤是这样的:
-
将 lib 添加到主项目中
git subtree add -P sub/libdir --squash lib_remote master
-
从库中获取更新
git subtree pull -P sub/libdir --squash lib_remote master
-
将更改推送到 lib_remote
git subtree push -P sub/libdir --squash lib_remote master
它对我来说效果很好(主项目和库,有一个很有意义的历史)。问题是git subtree push的时间,越来越长。
我使用 git-subtree 的目的和 Screndib 差不多,谁问 git-subtree is not retaining history so I cannot push subtree changes, how can I fix this/avoid this issue in the future?
我猜,在使用 --squash 时,每次处理 push 时,git subtree 都需要搜索“subtree add”以来的整个历史记录。
如何减少子树推送的时间?或者让它更有效地工作,而不是整个历史,只处理自上次 git subtree push(或 pull)以来的变化?
【问题讨论】:
-
注意:作为mentioned here(Git 2.5+,2015 年第二季度),
--squash不适用于git subtree push
标签: git git-subtree