如何减少推子树不断增加的时间?

编程入门 行业动态 更新时间:2024-10-28 18:35:06
本文介绍了如何减少推子树不断增加的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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 github/rtos/rtos.git 64546f..9454ce 9a9d34c5656655656565676768887899898767667348590 -> master

有什么方法可以清理"子树,从而减少推送更改的时间?

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

推荐答案

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

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.

请参见 git外部变量.

"git子模块"开始学习一种与远程分支的尖端集成的新模式(与集成在超级项目的gitlink中记录的提交相反).

"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

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

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.

更多推荐

如何减少推子树不断增加的时间?

本文发布于:2023-10-28 13:58:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536825.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:子树   时间

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!