0%

git hook 环境变量

Docker下安装的gogs

git hook 执行时的环境变量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
HOSTNAME=gogs-gogs1                                                                                                                                              
TERM=xterm
USER=git
GOGS_REPO_CUSTOM_HOOKS_PATH=/data/git/gogs-repositories/user/gitRepo.git/custom_hooks
GOGS_REPO_ID=2
GIT_PUSH_OPTION_COUNT=0
PATH=/usr/libexec/git-core:/usr/libexec/git-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/data/git/gogs-repositories/user/gitRepo.git
GOGS_REPO_OWNER_NAME=user
GOGS_AUTH_USER_NAME=user
GOGS_REPO_NAME=gitRepo
SHLVL=4
HOME=/data/git
SSH_ORIGINAL_COMMAND=1
GOGS_AUTH_USER_ID=1
GOGS_AUTH_USER_EMAIL=xxxx@mail.com
GOGS_CUSTOM=/data/gogs
GOGS_REPO_OWNER_SALT_MD5=94d5344c25db5ceaea76fff71f44dd51

打印环境变量

1
2
3
#!/usr/bin/env bash
unset GIT_DIR
env