我正在使用 ubuntu,并且我有一个文件夹 gitrepos,其中包含来自 github 的多个 git repos 的许多克隆。
我想要一个脚本,它可以自动在我的所有存储库中执行 git pull。
说
[gitrepos]
[repo1]
[repo2]
[repo3]
...
我想要一个脚本从所有 repo 中执行 git pull
注意 repo 名称不同。
有任何可用的 shell 或 py 脚本吗?
看看mr,一个正是为此而设计的工具。
这行得通:
来自 ~/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;