本文介绍了Git子模块初始化异步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在有很多子模块的项目上第一次运行 git submodule update --init
时,通常需要很长时间,因为大多数子模块都是存储在缓慢的公共服务器上。
是否有可能异步初始化子模块?
解决方案 Linux:
cat .gitmodules | grep -Po'。*'| sed's /。\(。\ + \)。$ / \ 1 /'|而睡眠0.1&读线;做git submodule更新--init $ line&完成
Mac:
cat .gitmodules | grep -o'。*'| cut -d'''-f 2 | while sleep 0.1& read line; git submodule update --init $ line& done
When I run git submodule update --init
first time on a projects which have a lot of submodules, this usually take a lot of time, because most of submodules are stored on slow public servers.
Is there a possibility to initialize submodules asynchronously?
解决方案
Linux:
cat .gitmodules | grep -Po '".*"' | sed 's/.\(.\+\).$/\1/' | while sleep 0.1 && read line; do git submodule update --init $line & done
Mac:
cat .gitmodules | grep -o '".*"' | cut -d '"' -f 2 | while sleep 0.1 && read line; do git submodule update --init $line & done
这篇关于Git子模块初始化异步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!