减少推动子树的时间 [英] Reduce increasing time to push a subtree

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

问题描述

我在项目中使用 git 的问题,它由几个子项目组成。每个子项目都使用 git-subtree 命令。这是我通过 git 来实现svn externals的方法。我使用它几周以来,但在每次提交期间,从子树到远程位置的更改时间都会增加。它看起来像这样,当我使用命令推送更改时

  git子树push -P platform / rtos rtos master 

git push使用:rtos master

1/215(0)2/215(1)3/215(2)4/215(3)5/215 )(5)7/215(6)8/215(7)9/215(8)10/215(9)11/215(9)12/215(10)13/215 /
....

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

是否有任何方法可以清理子树,从而减少推送更改的时间?

解决方案

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



请参阅 git externals


子模块开始学习一种新的模式,以便与远程分支的提示集成(而不是整合超级项目的gitlink中记录的提交)。

这可以使得更快的推送,同时从子模块的附加信息中受益子树(即子模块特定提交的轻量级记录)

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

  git submodule update --remote 



< blockquote>

此选项仅对 update 命令有效。

不是使用超级项目的已记录SHA-1来更新该子模块使用子模块的远程跟踪分支的状态。


I'm using in my project, which consists of several sub-projects. Each sub-project is "linked" in the main project using the command. That's my way to realize "svn externals" in . I'm using it since some weeks, but the time pushing my changes from the subtree to the remote location increases during every commit. It looks like this, when I'm pushing the changes using the command

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 pushing the 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天全站免登陆