Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Rick Osborne's super-easy gitflow installer oneliner to the pro…

…ject.

See the README file for instructions on how to use it.
  • Loading branch information...
commit 4f0f539130e0a4ab7883701dfd43fd8aec6799fc 1 parent f68d405
@nvie authored
Showing with 85 additions and 0 deletions.
  1. +1 −0  AUTHORS
  2. +6 −0 README.mdown
  3. +78 −0 contrib/gitflow-installer.sh
View
1  AUTHORS
@@ -5,5 +5,6 @@ Authors are (ordered by first commit date):
- Daniel Truemper
- Jason L. Shiffer
- Randy Merrill
+- Rick Osborne
Portions derived from other open source works are clearly marked.
View
6 README.mdown
@@ -12,6 +12,12 @@ blog post").
Installing git-flow
-------------------
+The easiest way to install git-flow is using Rick Osborne's excellent
+git-flow installer, which can be run using the following command:
+
+ $ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
+
+If you prefer a manual installation, please use the following instructions.
After downloading the sources from Github, also fetch the submodules:
$ git submodule init
View
78 contrib/gitflow-installer.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+# git-flow make-less installer for *nix systems, by Rick Osborne
+# Based on the git-flow core Makefile:
+# http://github.com/nvie/gitflow/blob/master/Makefile
+
+# Licensed under the same restrictions as git-flow:
+# http://github.com/nvie/gitflow/blob/develop/LICENSE
+
+# Does this need to be smarter for each host OS?
+if [ -z "$INSTALL_PREFIX" ] ; then
+ INSTALL_PREFIX="/usr/local/bin"
+fi
+
+if [ -z "$REPO_NAME" ] ; then
+ REPO_NAME="gitflow"
+fi
+
+if [ -z "$REPO_HOME" ] ; then
+ REPO_HOME="http://github.com/nvie/gitflow.git"
+fi
+
+EXEC_FILES="git-flow"
+SCRIPT_FILES="git-flow-init git-flow-feature git-flow-hotfix git-flow-release git-flow-support git-flow-version gitflow-common gitflow-shFlags"
+SUBMODULE_FILE="gitflow-shFlags"
+
+echo "### gitflow no-make installer ###"
+
+case "$1" in
+ uninstall)
+ echo "Uninstalling git-flow from $INSTALL_PREFIX"
+ if [ -d "$INSTALL_PREFIX" ] ; then
+ for script_file in $SCRIPT_FILES $EXEC_FILES ; do
+ echo "rm -vf $INSTALL_PREFIX/$script_file"
+ rm -vf "$INSTALL_PREFIX/$script_file"
+ done
+ else
+ echo "The '$INSTALL_PREFIX' directory was not found."
+ echo "Do you need to set INSTALL_PREFIX ?"
+ fi
+ exit
+ ;;
+ help)
+ echo "Usage: [environment] gitflow-installer.sh [install|uninstall]"
+ echo "Environment:"
+ echo " INSTALL_PREFIX=$INSTALL_PREFIX"
+ echo " REPO_HOME=$REPO_HOME"
+ echo " REPO_NAME=$REPO_NAME"
+ exit
+ ;;
+ *)
+ echo "Installing git-flow to $INSTALL_PREFIX"
+ if [[ -d "$REPO_NAME" && -d "$REPO_NAME/.git" ]] ; then
+ echo "Using existing repo: $REPO_NAME"
+ else
+ echo "Cloning repo from GitHub to $REPO_NAME"
+ git clone "$REPO_HOME" "$REPO_NAME"
+ fi
+ if [ -f "$REPO_NAME/$SUBMODULE_FILE" ] ; then
+ echo "Submodules look up to date"
+ else
+ echo "Updating submodules"
+ lastcwd=$PWD
+ cd "$REPO_NAME"
+ git submodule init
+ git submodule update
+ cd "$lastcwd"
+ fi
+ install -v -d -m 0755 "$INSTALL_PREFIX"
+ for exec_file in $EXEC_FILES ; do
+ install -v -m 0755 "$REPO_NAME/$exec_file" "$INSTALL_PREFIX"
+ done
+ for script_file in $SCRIPT_FILES ; do
+ install -v -m 0644 "$REPO_NAME/$script_file" "$INSTALL_PREFIX"
+ done
+ exit
+ ;;
+esac
Please sign in to comment.
Something went wrong with that request. Please try again.