Skip to content

Instantly share code, notes, and snippets.

@bradlucas
Last active May 3, 2016 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradlucas/5ea1cd2f25cd18d79a27 to your computer and use it in GitHub Desktop.
Save bradlucas/5ea1cd2f25cd18d79a27 to your computer and use it in GitHub Desktop.
simple-git-flow-enhancements.sh
#!/bin/bash
# --------------------------------------------------------------------------------
#
# The following functions assume that you have installed the Git Flow Extensions
# available here:
#
# https://github.com/petervanderdoes/gitflow-avh
#
# On a Mac simply enter the following from a Terminal window
#
# $ brew install git-flow-avh
#
# To initialize your repo for Git Flow enter the following and accept the defaults
#
# $ git flow init
#
# The Simple Git Flow Pattern reduces Git Flow to only features and releases.
# Start all development with a feature. When finished the feature is merged back
# to develop. This continues till a release is desired.
#
# A release should be named as a three digit number. After starting a release do
# your version increment and commit the change on the release branch. All testing
# should be done from the release branch as well as the subsequent release. When
# the release has been deployed use the git-finish-release function to have your
# release merged back to develop and master. Note, that it would be considered
# good form to update your projects Readme while on the release branch with notes
# about what is new for the release.
#
# When finishing a release or feature you'll be prompted for commit messages when
# necessary. Use a good summary message for your feature. If your feature has a
# large number of commits consider summarizing all the commits. For releases
# a simple version number will suffice for the final message.
#
# --------------------------------------------------------------------------------
function git-flow {
echo "git-start-feature <feature-name>"
echo "git-finish-feature <feature-name>"
echo "git-start-release <release-name>"
echo "git-finish-relase <release-name>"
}
function git-start-feature {
echo ""
if [ -z "$1" ]
then
echo "Enter feature name"
else
echo $1
git flow feature start $1
fi
}
function git-finish-feature {
if [ -z "$1" ]
then
echo "Enter feature name"
else
echo $1
git flow feature finish --no-ff -k $1
fi
}
function git-start-release {
echo ""
if [ -z "$1" ]
then
echo "Enter release name"
else
echo $1
git flow release start $1
fi
}
function git-finish-release {
if [ -z "$1" ]
then
echo "Enter release name"
else
echo $1
git flow release finish -k $1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment