简体   繁体   English

服务器中客户端 git hooks 的位置在哪里

[英]where is the location of client side git hooks in server

I want to deploy my own version of git client side hooks.我想部署我自己版本的 git 客户端挂钩。 for this, i need to know whether the client side hooks are generated from the clients system or are also cloned from the server.为此,我需要知道客户端挂钩是从客户端系统生成还是从服务器克隆。 If it is cloned from the server, what is the location where the client side hooks are located?如果是从服务端克隆过来的,客户端钩子所在的位置是什么?

The hooks location is under .git folder in your cloned folder钩子位置位于克隆文件夹中的.git文件夹下

.git
├── branches
├── COMMIT_EDITMSG
├── config
├── description
├── HEAD
├── hooks
├── index
├── info
├── logs
├── objects
└── refs

there is a folder hooks , where you can find post , pre hooks.有一个文件夹hooks ,您可以在其中找到postpre hooks 。

├── 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

rename .sample files to like post-update.sample to post-update to run pre , post hooks.将 .sample 文件重命名为post-update.samplepost-update以运行prepost钩子。

The client side hooks are not stored in server.客户端钩子不存储在服务器中。 Server has nothing to do with client side hooks in git.服务器与 git 中的客户端挂钩无关。 ie client side hooks and server side hooks are not inter-related.即客户端钩子和服务器端钩子不是相互关联的。 However, they are generated inside your local repository by your own local system.但是,它们是由您自己的本地系统在您的本地存储库中生成的。
In short, client side git hooks are not related to server and aren't stored there.简而言之,客户端 git 钩子与服务器无关,也不存储在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM