Reputation: 2398
I'm working under Windows 7 and I have installed msysgit and TortoiseGit. I wrote a pre-rebase hook for a git repository.
The hook is called when I rebase the repo from Git Bash. However the hook is not called if I start the rebase from TortoiseGit. I tried to write a pre-commit hook, and it works from bot Git Bash and TortoiseGit.
The hook is the following:
#!/bin/sh
#
# Copyright (c) 2006, 2008 Junio C Hamano
#
# The "pre-rebase" hook is run just before "git rebase" starts doing
# its job, and can prevent the command from running by exiting with
# non-zero status.
#
# The hook is called with the following parameters:
#
# $1 -- the upstream the series was forked from.
# $2 -- the branch being rebased (or empty when rebasing the current branch).
#
# This sample shows how to prevent topic branches that are already
# merged to 'next' branch from getting rebased, because allowing it
# would result in rebasing already published history.
echo '************************************************************'
echo '********************** Running CMake **********************'
echo '************************************************************'
cmake -G "Visual Studio 11" -BBuild/ -Hsrc
What's wrong?
Upvotes: 2
Views: 1273
Reputation: 44377
As far as I can see (using git reflog
), 'rebase' in TortoiseGit does not really perform a true git rebase
. Instead, TortoiseGit emulates a rebase using cherry-picks.
I don't know why, maybe it is to enable the gui for interactive rebase?
Anyway, since a true rebase is not performed, no rebase-related hook will be run.
Upvotes: 1