本文介绍了减少推动子树的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在项目中使用 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 。这可以使得更快的推送,同时从子模块的附加信息中受益子树(即子模块特定提交的轻量级记录) 您可以使用以下命令将该子模块更新为给定分支的最新版本: git submodule update --remote 此选项仅对 update 命令有效。 不是使用超级项目的已记录SHA-1来更新该子模块使用子模块的远程跟踪分支的状态。 I'm using git in my project, which consists of several sub-projects. Each sub-project is "linked" in the main project using the git-subtree command. That's my way to realize "svn externals" in git. 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 mastergit push using: 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 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 -> masterIs 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.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 这篇关于减少推动子树的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-22 19:50
查看更多