如何减少不断增加的推送子树的时间? [英] How can I reduce the ever-increasing time to push a subtree?

查看:11
本文介绍了如何减少不断增加的推送子树的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Git 子树 将几个子项目链接"到主项目中(我来自svn:externals").我已经使用它几个星期了,但是每次提交都会增加将更改推送到远程子树的时间.

$ git subtree push -P platform/rtos rtos mastergit push 使用:rtos master1/215 (0)2/215 (1)3/215 (2)4/215 (3)5/215 (4)6/215 (5)7/215 (6)8/215 (7)9/215 (8)10/215 (9)11/215 (9)12/215 (10)13/215 (11)14/...20 多行...(204)209/215 (205)210/215 (206)211/215 (207)212/215 (208)213/215 (209)214/215 (210)215/215 (211)到 https://github.com/rtos/rtos.git64546f..9454ce 9a9d34c5656655656565676768887899898767667348590 ->掌握

有没有办法清理"子树,从而减少推送更改的时间?

解决方案

请注意,如果您决定切换到 git submodule,你现在可以,自 git1.8.2 (2013-03-08) 跟踪子模块存储库的最新提交.

参见 git externals.

<块引用>

"git submodule" 开始学习一种新的模式来与远程分支的提示集成(而不是与记录在超级项目的 gitlink 中的提交集成).

这可以加快推送速度,同时受益于子模块在子树上的附加信息(即子模块特定提交的轻量级记录)

您可以使用以下命令将该子模块更新到给定分支的最新版本:

git submodule update --remote

<块引用>

此选项仅对 update 命令有效.
使用子模块远程跟踪分支的状态,而不是使用超级项目记录的 SHA-1 来更新子模块.

I'm using Git subtree to "link" several subprojects into the main project (I'm coming from "svn:externals"). I've used it for some weeks, but the time to push changes to the subtree remote increases every commit.

$ git subtree push -P platform/rtos rtos master

git push using:  rtos master

1/    215 (0)2/    215 (1)3/    215 (2)4/    215 (3)5/    215 (4)6/    215 (5)7/    215 (6)8/    215 (7)9/    215 (8)10/    215 (9)11/    215 (9)12/    215 (10)13/    215 (11)14/    
...
20 more lines
...
(204)209/    215 (205)210/    215 (206)211/    215 (207)212/    215 (208)213/    215 (209)214/    215 (210)215/    215 (211)To https://github.com/rtos/rtos.git
   64546f..9454ce  9a9d34c5656655656565676768887899898767667348590 -> master

Is there any way to "clean up" the subtree and therefore reduce the time to push changes?

解决方案

Note that if you decide to switch to git submodule, you now can, since git1.8.2 (2013-03-08) track the latest commits of a submodule repo.

See git externals.

"git submodule" started learning a new mode to integrate with the tip of the remote branch (as opposed to integrating with the commit recorded in the superproject's gitlink).

That could be make for quicker push, while benefiting from the additional information a submodule has over a subtree (i.e a lightweight record of a specific commit of the submodule)

You can update that submodule to the latest of a given branch with:

git submodule update --remote

This option is only valid for the update command.
Instead of using the superproject's recorded SHA-1 to update the submodule, use the status of the submodule's remote tracking branch.

这篇关于如何减少不断增加的推送子树的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆