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.

Revisions

  1. ma6174 created this gist Jan 5, 2014.
    27 changes: 27 additions & 0 deletions update_git.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #!/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