Skip to content

Instantly share code, notes, and snippets.

@devopsmariocom
Created March 20, 2015 07:45
Show Gist options
  • Save devopsmariocom/eae1cba9a31523d612c4 to your computer and use it in GitHub Desktop.
Save devopsmariocom/eae1cba9a31523d612c4 to your computer and use it in GitHub Desktop.
Simple script for git rebasing with force push
#!/bin/bash
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ $CURRENT_BRANCH == "develop" ];then
echo "Not allowed for develop branch"
else
git fetch origin && git rebase origin/develop && git push --force
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment