Skip to content

Instantly share code, notes, and snippets.

@zserghei
Created November 15, 2017 08:10
Show Gist options
  • Save zserghei/e8b3df2714ad849f83ef6d0e21edb019 to your computer and use it in GitHub Desktop.
Save zserghei/e8b3df2714ad849f83ef6d0e21edb019 to your computer and use it in GitHub Desktop.
Pull multiple git projects
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status.
for d in *; do
if [[ -d $d && -f $d/pom.xml ]]; then
echo " Processing $d"
git -C $d -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
git -C $d -c diff.mnemonicprefix=false -c core.quotepath=false pull origin
git -C $d -c diff.mnemonicprefix=false -c core.quotepath=false submodule update --init --recursive
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment