Skip to content

Instantly share code, notes, and snippets.

@DerZyklop
Last active April 5, 2016 20:09
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 DerZyklop/d7519cbc55e8b2489b2f6c66bbe491fe to your computer and use it in GitHub Desktop.
Save DerZyklop/d7519cbc55e8b2489b2f6c66bbe491fe to your computer and use it in GitHub Desktop.
Git Flow with Tagging and some console output
#!/bin/sh
echo "gf-ff $1"
if [[ $# -lt 1 ]]; then
echo "––––––––––––––––"
echo "USAGE: gf-ff [feature]"
echo "––––––––––––––––"
else
DEVELOPE_BRANCH=$(git config gitflow.branch.develop)
FEATURE_BRANCH=$(git config gitflow.prefix.feature)$1
# Make sure you have the newest commits
git checkout $FEATURE_BRANCH
git pull origin $FEATURE_BRANCH
# Make sure your stuff its on remote
git push origin $FEATURE_BRANCH
# Make sure your on the newes commit in dev branch
git checkout $DEVELOPE_BRANCH
git pull origin $DEVELOPE_BRANCH
# Merge it!
git merge $FEATURE_BRANCH
if [ $? -eq 0 ]; then
# Tag it. Its like a bookmark.
git tag $FEATURE_BRANCH
# Delete the feature branch
git branch -d $FEATURE_BRANCH
# Delete the feature branch on remote
# Attention! This is dangerous!
# git push origin --delete $FEATURE_BRANCH
# Share it with your workmates
git push
git push --follow-tags
# Keep it up
echo "––––––––––––––––––––––––––––––––"
echo "👍"
echo "––––––––––––––––––––––––––––––––"
else
echo "––––––––––––––––––––––––––––––––"
echo "❗ ACHTUNG ❗ ACHTUNG ❗ ACHTUNG ❗"
echo "Es gab Konflikte beim mergen. Was nun zu tun ist:"
echo "1: Konflikte beseitigen"
echo "2: Konfliktfreie Dateien adden per:"
echo " git add ."
echo "3: Merge-Commit machen (ohne eigene message!) per:"
echo " git commit"
echo "4: Git-Flow-Command noch ein mal ausführen:"
echo " gf-ff $1"
echo "––––––––––––––––––––––––––––––––"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment