更新一个目录下所有的 Git Repo
Mar 12, 2017
#更新一个目录下所有的 Git Repo
我的 ~ 下面有一堆的 Git Repo, 有些可能很久没更新了, 然后一个个 cd 进去 pull 又太麻烦, 它们又不是 submodule .
于是 SO 上已经有解了 w.
git config --global alias.all '!f() { ls -R -d */.git | sed 's,\/.git,,' | xargs -P10 -I{} git -C {} $1; }; f'
只需要加上 all
的话, Git 指令就会作用于所有当前文件夹下的 Repo 了 /
比如:
➜ ~ git all pull
#然后看到了成吨的更新(
Source: http://stackoverflow.com/questions/3497123/run-git-pull-over-all-subdirectories
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.