Update git repos in parallel

joaovitor

João Vitor

Posted on October 29, 2020

Update git repos in parallel

Are you living in a microservices world?
Do you need to keep multiple git repositories in sync?

How much time would it take to update 63 repositories?

The update-repos.sh script uses gnu-parallel and execute the git pull --rebase and git fetch --prune in parallel.

Update repositories in parallel

cd ~/github-orgs/PacktPublishing
time update-repos.sh
Enter fullscreen mode Exit fullscreen mode

Output:

[truncated]
job 56 completed ./Develop-and-Operate-Microservices-on-Kubernetes
Already up to date.
job 55 completed ./DevOps-Puppet-Docker-and-Kubernetes
Already up to date.
job 62 completed ./-Kubernetes-for-Absolute-Beginners---Hands-on
[truncated]

real    0m9,083s
user    0m6,321s
sys     0m2,668s
Enter fullscreen mode Exit fullscreen mode

If you do that synchronously it would have taken near 4 minutes.

real    4m53,583s
user    0m6,480s
sys     0m4,776s
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
joaovitor
João Vitor

Posted on October 29, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Update git repos in parallel
linux Update git repos in parallel

October 29, 2020

Using gnu parallel to save time
linux Using gnu parallel to save time

October 29, 2020