Skip to content

Instantly share code, notes, and snippets.

@ma6174
Created January 5, 2014 07:09
Show Gist options
  • Save ma6174/8265337 to your computer and use it in GitHub Desktop.
Save ma6174/8265337 to your computer and use it in GitHub Desktop.
批量更新git仓库
#!/bin/bash
pulls="repo1 repo2 repo3"
fetchs="repo4 repo5"
branch="yourBranch"
remote="yourRemoteGitName"
for i in $pulls
do
echo ">>>>>>>>$i"
cd $i
git remote -v
git checkout $branch
git pull
make
cd ..
done
for i in $fetchs
do
echo ">>>>>>>>$i"
cd $i
git remote -v
git checkout $branch
git fetch $remote
git merge $remote/$branch
make
git push
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment