Skip to content

Instantly share code, notes, and snippets.

@pavanpodila
Last active April 20, 2024 11:41
Show Gist options
  • Select an option

  • Save pavanpodila/5273693 to your computer and use it in GitHub Desktop.

Select an option

Save pavanpodila/5273693 to your computer and use it in GitHub Desktop.

Revisions

  1. pavanpodila revised this gist Mar 29, 2013. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion create_export_pack.sh
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,8 @@ for branch in $branches; do
    cp -R ./ $EXPORT_DIR/$name
    done

    rm -rf ../tmp
    cd ..
    rm -rf tmp

    # back to where we were
    cd $previous_pwd
  2. pavanpodila created this gist Mar 29, 2013.
    26 changes: 26 additions & 0 deletions create_export_pack.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    previous_pwd=$PWD

    cd $(dirname $0)


    PROJECT="$HOME/Desktop/project"
    EXPORT_DIR="$HOME/Desktop/export"

    rm -rf $EXPORT_DIR
    mkdir -p $EXPORT_DIR

    rm -rf tmp
    mkdir tmp
    cd tmp
    git clone $PROJECT .

    branches=($(git branch -a | grep remotes | grep -v HEAD | grep -v master))

    for branch in $branches; do

    local name=${branch/remotes\/origin\//}
    git checkout origin/$name
    cp -R ./ $EXPORT_DIR/$name
    done

    rm -rf ../tmp