【发布时间】:2014-03-21 21:51:29
【问题描述】:
我在 Windows 7 下工作,我已经安装了 msysgit 和 TortoiseGit。 我为 git 存储库编写了一个 pre-rebase 挂钩。
当我从 Git Bash 重新构建 repo 时会调用该钩子。 但是,如果我从 TortoiseGit 启动变基,则不会调用钩子。 我尝试编写一个预提交钩子,它适用于 bot Git Bash 和 TortoiseGit。
钩子如下:
#!/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
怎么了?
【问题讨论】:
标签: git githooks tortoisegit