我有一个可执行文件 .git/hooks/post-rewrite
文件,用于测试目的
其中有以下几行:
#!/bin/bash
echo "Notice: post-rewrite hook is running"
我的理解是 post-rewrite
钩子(Hook)在重写提交历史的操作之后运行,例如 rebase
和 git 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; orgit pull --rebase
您不是重写任何提交;你在快进;所以基本上你的分支只是指向另一个提交。没有任何提交被重写。
关于Git 重写后未执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39147452/