Forked from sunitparekh/git-pull-with-rebase-multi-repository-shell-script
Created
June 5, 2021 06:39
-
-
Save allexradu/0bc669dbdd939cf361b6726d2698711e to your computer and use it in GitHub Desktop.
Shell script to pull latest code from remote git repository for multiple projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment