Skip to content

Instantly share code, notes, and snippets.

@goyalmohit

goyalmohit/pre-rebase-2.sh

Last active Apr 14, 2019
Embed
What would you like to do?
Shell script for pre-rebase git hook to disable rebasing on different branch
#!/bin/sh
# disallows rebasing on different branch only
if [ ! -z $2 ]; then
echo "pre-rebase: Rebasing is dangerous, follow the golden rules of rebasing."
exit 1
else
echo "pre-rebase: Be careful of what you do"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment