Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sunitparekh/fd056741bbe7a43cc4f0 to your computer and use it in GitHub Desktop.
Save sunitparekh/fd056741bbe7a43cc4f0 to your computer and use it in GitHub Desktop.
Shell script to pull latest code from remote git repository for multiple projects
#!/bin/bash
repos=(
"/c/projects/project-1"
"/c/projects/project-2"
"/c/projects/project-3"
)
echo ""
echo "Getting latest for" ${#repos[@]} "repositories using pull --rebase"
for repo in "${repos[@]}"
do
echo ""
echo "****** Getting latest for" ${repo} "******"
cd "${repo}"
git pull --rebase
echo "******************************************"
done
@julkwel
Copy link

julkwel commented Aug 10, 2018

Thanks

@kamjony
Copy link

kamjony commented Mar 4, 2020

Thank you so much :D

@forwarehouse
Copy link

ThankYouPro

@kenny-lee-1992
Copy link

Thank you, so nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment