From: Stephen Haberman Date: Sun, 22 Jun 2008 20:13:50 +0000 (-0500) Subject: Actual file for post-checkout-rebase. X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=804e3857f0dbd9e456795697ac889ca23f3f050f;p=git-central.git Actual file for post-checkout-rebase. --- diff --git a/client/post-checkout-rebase b/client/post-checkout-rebase new file mode 100644 index 0000000..613b97e --- /dev/null +++ b/client/post-checkout-rebase @@ -0,0 +1,15 @@ +#!/bin/bash + +# The hook is given three parameters: the ref of the previous HEAD, the ref of +# the new HEAD (which may or may not have changed), and a flag indicating +# whether the checkout was a branch checkout (changing branches, flag=1) or a +# file checkout (retrieving a file from the index, flag=0). + +branch=$(git symbolic-ref HEAD) +branch=${branch/refs\/heads\//} + +git config --list | grep "branch.${branch}.rebase" > /dev/null +if [ $? -ne 0 ] ; then + git config --add "branch.${branch}.rebase" true +fi +