当前位置: 首页 > news >正文

东莞石龙网站建设定制产品类型 速成网站

东莞石龙网站建设定制,产品类型 速成网站,微网站矩阵怎么做,网易企业邮箱登录v参考文章:详解如何在项目中使用git Hooks(husky、yorkie) git hooks钩子 git hooks是一些自定义的脚本,用于控制git工作的流程,分为客户端钩子和服务端钩子。  ~/work/step-time/ [master*] ll .git/hooks total…

参考文章:详解如何在项目中使用git Hooks(husky、yorkie)

git hooks钩子

git hooks是一些自定义的脚本,用于控制git工作的流程,分为客户端钩子和服务端钩子。

 ~/work/step-time/ [master+*] ll .git/hooks 
total 128
-rwxr-xr-x  1 admin  staff   478B  8 19 18:52 applypatch-msg.sample
-rwxr-xr-x  1 admin  staff   896B  8 19 18:52 commit-msg.sample
-rwxr-xr-x  1 admin  staff   4.5K  8 19 18:52 fsmonitor-watchman.sample
-rwxr-xr-x  1 admin  staff   189B  8 19 18:52 post-update.sample
-rwxr-xr-x  1 admin  staff   424B  8 19 18:52 pre-applypatch.sample
-rwxr-xr-x  1 admin  staff   1.6K 11 12 17:42 pre-commit
-rwxr-xr-x  1 admin  staff   1.6K 11 12 17:00 pre-commit.sample.bck
-rwxr-xr-x  1 admin  staff   416B  8 19 18:52 pre-merge-commit.sample
-rwxr-xr-x  1 admin  staff   1.3K  8 19 18:52 pre-push.sample
-rwxr-xr-x  1 admin  staff   4.8K  8 19 18:52 pre-rebase.sample
-rwxr-xr-x  1 admin  staff   544B  8 19 18:52 pre-receive.sample
-rwxr-xr-x  1 admin  staff   1.5K  8 19 18:52 prepare-commit-msg.sample
-rwxr-xr-x  1 admin  staff   2.7K  8 19 18:52 push-to-checkout.sample
-rwxr-xr-x  1 admin  staff   3.6K  8 19 18:52 update.sample
 ~/work/step-time/ [master+*] 
 ~/work/step-time/ [master+*] 
 ~/work/step-time/ [master+*] 

.git.hooks目录下的就是勾子,想要运行她们只需要去除.sample后缀,并且把文件改成可执行的就可以了。

pre-commit.sample介绍

#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments.  The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".# 获取提交的文件名
if git rev-parse --verify HEAD >/dev/null 2>&1
thenagainst=HEAD
else# Initial commit: diff against an empty tree objectagainst=$(git hash-object -t tree /dev/null)
fi# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --type=bool hooks.allownonascii)# Redirect output to stderr.
exec 1>&2# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&# Note that the use of brackets around a tr range is ok here, (it's# even required, for portability to Solaris 10's /usr/bin/tr), since# the square bracket bytes happen to fall in the designated range.## 获取改动的文件名,使用tr删除ascii表的0到126的字符,## 也就是计算non-ASCII 的字符数量test $(git diff --cached --name-only --diff-filter=A -z $against |LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
thencat <<\EOF
Error: Attempt to add a non-ASCII file name.This can cause problems if you want to work with people on other platforms.To be portable it is advisable to rename the file.If you know what you are doing you can disable this check using:git config hooks.allownonascii true
EOFexit 1
fi# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
http://www.yayakq.cn/news/671660/

相关文章:

  • 无锡市城乡和住房建设局网站wordpress图片本地化插件
  • 企业建设网站的资金策划申请建设网站的报告书
  • 可以查企业备案的网站吗查询网 域名查询
  • 烟台公司网站定制安福相册网站怎么做的
  • 网站建设合同 包括什么百度推广 网站建设
  • 佛山 顺德网站设计嵌入式软件开发工具的发展趋势是什么
  • discuz!网站模板电信宽带做网站服务器
  • 哈尔滨网站建设 seo凯里官网
  • 网站开发业务怎么开展建设网站案例
  • 做盗版小说网站怎么样重庆市交通建设工会网站
  • 网站安装php阜新市网站建设
  • 建设网站公司排名石排镇专业建站公司
  • 建设银行账户网站查询密码海南在线新闻中心
  • 网站跳转怎么解释网站开发过程有几个阶段
  • 网站开发进度计划书简单的html网页制作模板免费
  • 为什么要建设种苗供求网站网站推荐男生正能量
  • 网站做下要多少站外推广方式
  • 有了域名自己电脑怎么做网站深圳网站建设网站设计软文推广
  • 石岩企业网站建设物流公司名称起名大全
  • 做新房什么网站好克隆网站首页做单页站几个文件
  • 交互式网站模板wordpress线下安装教程
  • 网站建设专家评审意见厦门seo代运营
  • 深圳网站建设 东莞网站建设上海建网站哪家好
  • 谷哇网站建设猎聘网招聘网页版
  • 成都优化网站厂家台州网站制作咨询薇
  • 北京市建设工程质监站网站湘潭企业seo优化哪家好
  • 西双版纳州住房和城乡建设局网站企业信息公开查询
  • 网站站建设建设中页中页做肯德基玻璃门网站
  • 专做蓝领的网站网站建设的元素
  • 怎样建手机网站厦门公司注册代理