Guest User

wicket git multiple workspaces

a guest
Jun 29th, 2012
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.60 KB | None | 0 0
  1. BRANCHES="master wicket-1.4.x wicket-1.5.x"
  2. mkdir wicket
  3. cd wicket
  4.  
  5. git clone https://git-wip-us.apache.org/repos/asf/wicket.git wicket-git-repo
  6.  
  7. for b in $BRANCHES; do
  8.    mkdir $b
  9.    pushd $b > /dev/null
  10.    git init
  11.    pushd .git > /dev/null
  12.    for f in branches config hooks info objects refs packed-refs; do
  13.       rm -rf $f
  14.       ln -sf ../../wicket-git-repo/.git/$f $f
  15.    done
  16.    popd > /dev/null # out of the .git dir
  17.  
  18.    if [ `git branch | grep $b | wc -l` -eq 0 ]; then
  19.       git branch --track $b origin/$b
  20.    fi
  21.    git checkout $b
  22.    popd > /dev/null # out of the branch dir
  23. done
Advertisement
Add Comment
Please, Sign In to add comment