【问题标题】:When I do a git pull with rebase, how do I disable the rebase hook?当我使用 rebase 执行 git pull 时,如何禁用 rebase 挂钩?
【发布时间】:2013-08-18 21:58:13
【问题描述】:
命令:
git rebase --no-verify
...允许我在不运行我创建的 git rebase 挂钩的情况下进行 rebase。
但我也将 git pull 设置为变基而不是合并,所以现在当我执行拉动时,它会运行我的变基触发器。有没有办法将 --no-verify 选项传递给 git pull 并让它在变基时使用该选项?
(除了创建包装脚本临时将触发器移开,然后再将它们移回的最后手段之外)。
【问题讨论】:
标签:
git
git-rebase
githooks
git-pull
【解决方案1】:
嗯,你可以分两步完成:
git fetch <remote> <branch>
git rebase <remote>/<branch> --no-verify
这两个操作与git pull --rebase 或git pull 是同义词,配置为使用rebase 而不是合并。您还可以创建一个别名,将这两个操作组合为一个,并将其命名为 pull-no-verify 或类似名称。