Skip to content

Instantly share code, notes, and snippets.

@goyalmohit
Last active April 14, 2019 13:20
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 goyalmohit/b56ae5942811e7b2447966482255c509 to your computer and use it in GitHub Desktop.
Save goyalmohit/b56ae5942811e7b2447966482255c509 to your computer and use it in GitHub Desktop.
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