Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git挂钩-合并后挂钩文件不存在_Git_Version Control_Githooks - Fatal编程技术网

Git挂钩-合并后挂钩文件不存在

Git挂钩-合并后挂钩文件不存在,git,version-control,githooks,Git,Version Control,Githooks,我是Git版本控制系统的新手。 我已经在我的Ubuntu机器上安装了git。 只有以下挂钩可用 applypatch-msg.sample commit-msg.sample post-update.sample pre-applypatch.sample pre-commit.sample prepare-commit-msg.sample pre-push.sample pre-rebase.sample update.sample “后期合并”钩子文件在哪里?中引入了后期合并钩子,但从未

我是Git版本控制系统的新手。 我已经在我的Ubuntu机器上安装了git。 只有以下挂钩可用

applypatch-msg.sample
commit-msg.sample
post-update.sample
pre-applypatch.sample
pre-commit.sample
prepare-commit-msg.sample
pre-push.sample
pre-rebase.sample
update.sample

“后期合并”钩子文件在哪里?

中引入了后期合并钩子,但从未包含
后期合并.sample
文件

diff --git a/git-merge.sh b/git-merge.sh
index 3a01db0..66e48b3 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -97,6 +97,19 @@ finish () {
                fi
                ;;
        esac
+
+       # Run a post-merge hook
+        if test -x "$GIT_DIR"/hooks/post-merge
+        then
+           case "$squash" in
+           t)
+                "$GIT_DIR"/hooks/post-merge 1
+               ;;
+           '')
+                "$GIT_DIR"/hooks/post-merge 0
+               ;;
+           esac
+        fi
 }
因此,如果需要挂钩,您可以创建一个
合并后
文件(在通常的位置
.git/hooks/
)。但是你和其他人在同一个地方没有任何样品

通过调用以下命令添加了引用a
post merge
sample:

该脚本包括:

要还原权限/所有权数据,请将此脚本放在
.git/hooks
目录中,并使用以下行启用
post merge
hook:


是…?,非常感谢!
  #!/bin/sh
 . git-sh-setup
 $GIT_DIR/hooks/setgitperms.perl -w