19

我正在使用 ubuntu,并且我有一个文件夹 gitrepos,其中包含来自 github 的多个 git repos 的许多克隆。

我想要一个脚本,它可以自动在我的所有存储库中执行 git pull。

[gitrepos]
  [repo1]
  [repo2]
  [repo3]
    ...

我想要一个脚本从所有 repo 中执行 git pull
注意 repo 名称不同。

有任何可用的 shell 或 py 脚本吗?

4

2 回答 2

18

看看mr,一个正是为此而设计的工具。

于 2012-11-13T15:15:47.867 回答
15

这行得通:

来自 ~/gitrepos:

for REPO in `ls`; do (cd "$REPO"; git pull); done;

从任何地方:

for REPO in "`find ~/gitrepos -maxdepth 0 -type d`"; do (cd "$REPO"; git pull); done;
于 2012-11-12T02:10:54.867 回答