Robware Software by Rob

A simple script to update a collection of repositories

When you're dealing with a microservice architecture solution, it's likely you have a lot of small repositories. Keeping them up to date can be a pain, so I wrote a simple script to update each directory:

Bash:

#!/usr/bin/env bash

for f in *; do
	if [ -d "$f" ]; then
		cd $f
		git pull
		cd ..
	fi
done

Batch:

@echo off
FOR /D %%f IN ("*") DO (
	cd %%f
	git pull
	cd ..
)

Pretty basic stuff; just goes in to each directory and does a pull. Saves having to do the same thing yourself. Particularly useful if you've not picked up the project in a while.

Posted on Wednesday the 22nd of January 2020