Git 重写后未执行

标签 git git-rebase githooks

我有一个可执行文件 .git/hooks/post-rewrite文件,用于测试目的 其中有以下几行:

#!/bin/bash

echo "Notice: post-rewrite hook is running"

我的理解是 post-rewrite钩子(Hook)在重写提交历史的操作之后运行,例如 rebasegit commit --amend .

的确,正在运行 git commit --ammend将消息打印到 stdout提交后。然而,当我做 git rebase master来自 master 后面的分支, 或 git pull --rebase , 没有打印到 stdout .

我错过了什么吗?

最佳答案

when I do git rebase master for a branch that is behind master; or git pull --rebase

您不是重写任何提交;你在快进;所以基本上你的分支只是指向另一个提交。没有任何提交被重写。

关于Git 重写后未执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39147452/

相关文章:

混帐/gitorious : Way to share certain branches/repositories with the customer

跨多个分支的 Git interactive-rebase

git 在 rebase 期间崩溃

Git Hook : once a branch is merged into master - update JIRA status

git - 设置一个 git hook 以在远程服务器上自动 git pull

git - 在推送时让 git 重新格式化源代码

git - Grep Git 分支名称,只返回名称包含 "Theme"的分支

git - 如何删除除最后五个之外的所有 Git 提交

git - 我可以将我的 git 存储库的 gh-pages 分支作为 Master 分支的镜像吗?

git - 两种 git rebase 方法之间的区别