Created
January 5, 2014 07:09
-
-
Save ma6174/8265337 to your computer and use it in GitHub Desktop.
批量更新git仓库
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 | |
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