Skip to content

Instantly share code, notes, and snippets.

@silverkorn
Last active August 29, 2015 14:26
Show Gist options
  • Save silverkorn/af2e55dbef1e7089af70 to your computer and use it in GitHub Desktop.
Save silverkorn/af2e55dbef1e7089af70 to your computer and use it in GitHub Desktop.
Gitflow (incl. AVH Edition) installer for Git For Windows
#!/bin/bash
# Gitflow (AVH Edition) installer for Git For Windows, by Danny Boisvert
# Licensed under the same restrictions as git-for-windows' build-extra:
# http://github.com/git-for-windows/build-extra/blob/master/git-extra/PKGBUILD
echo
echo "Installing Gitflow (AVH Edition) & Gitflow (AVH Edition) completion..."
echo
GITFLOW_REPO="gitflow"
GITFLOW_COMPLETION_REPO="git-flow-completion"
# Work in the `tmp/` directory
pushd "tmp" > /dev/null
# Gitflow repository
[ ! -d "tmp/gitflow" ] && git clone "https://github.com/petervanderdoes/${GITFLOW_REPO}.git" && DELETE_GITFLOW_REPO=1
# Gitflow completion repository
[ ! -d "tmp/git-flow-completion" ] && git clone "https://github.com/petervanderdoes/${GITFLOW_COMPLETION_REPO}.git" && DELETE_GITFLOW_COMPLETION_REPO=1
popd > /dev/null
# Apply to every "mingw" directories
for dir in $(ls -lA | gawk -F':[0-9]* ' '/:/{print $2}')
do
if [ ${dir:0:5} = "mingw" ];
then
if [ -d "$dir" ];
then
# Gitflow (AVH Edition)
pushd "tmp/gitflow" > /dev/null && \
export PREFIX="../../${dir}"
bash -c "contrib/gitflow-installer.sh install stable"
popd > /dev/null
# Gitflow (AVH Edition) completion
pushd "tmp/git-flow-completion" > /dev/null && \
cp -f git-flow-completion.* "../../${dir}/share/git/completion/"
popd > /dev/null
fi
fi
done
# Remove repositories if wasn't already there
[ "$DELETE_GITFLOW_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_REPO}"
[ "$DELETE_GITFLOW_COMPLETION_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_COMPLETION_REPO}"
echo
echo "Done."
echo
#!/bin/bash
# Gitflow installer for Git For Windows, by Danny Boisvert
# Licensed under the same restrictions as git-for-windows' build-extra:
# http://github.com/git-for-windows/build-extra/blob/master/git-extra/PKGBUILD
echo
echo "Installing Gitflow & Gitflow completion..."
echo
GITFLOW_REPO="gitflow"
GITFLOW_COMPLETION_REPO="git-flow-completion"
# Work in the `tmp/` directory
pushd "tmp" > /dev/null
# Gitflow repository
[ ! -d "tmp/gitflow" ] && git clone "https://github.com/nvie/${GITFLOW_REPO}.git" && DELETE_GITFLOW_REPO=1
# Gitflow completion repository
[ ! -d "tmp/git-flow-completion" ] && git clone "https://github.com/bobthecow/${GITFLOW_COMPLETION_REPO}.git" && DELETE_GITFLOW_COMPLETION_REPO=1
popd > /dev/null
# Apply to every "mingw" directories
for dir in $(ls -lA | gawk -F':[0-9]* ' '/:/{print $2}')
do
if [ ${dir:0:5} = "mingw" ];
then
if [ -d "$dir" ];
then
# Gitflow
pushd "tmp/gitflow" > /dev/null && \
export INSTALL_PREFIX="../../${dir}/bin"
bash -c "contrib/gitflow-installer.sh install"
popd > /dev/null
# Gitflow completion
pushd "tmp/git-flow-completion" > /dev/null && \
cp -f git-flow-completion.* "../../${dir}/share/git/completion/"
popd > /dev/null
fi
fi
done
# Remove repositories if wasn't already there
[ "$DELETE_GITFLOW_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_REPO}"
[ "$DELETE_GITFLOW_COMPLETION_REPO" == 1 ] && rm -R -f "tmp/${GITFLOW_COMPLETION_REPO}"
echo
echo "Done."
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment