gc-guide-api/.githooks/post-checkout
htlee d332283e86 feat: Spring Boot 3.5 + JDK 17 초기 프로젝트 구성
- Spring Boot 3.5.2 + Spring Security + JPA + PostgreSQL
- Google OAuth2 ID Token 검증 (google-api-client)
- JWT 인증 (jjwt 0.12.6)
- H2 인메모리 DB (로컬) / PostgreSQL (운영) 프로필 분리
- Nexus 프록시 경유 Maven 빌드 설정
- 팀 워크플로우 템플릿 (common + java-maven) 적용
2026-02-14 13:00:24 +09:00

26 lines
942 B
Bash
Executable File

#!/bin/bash
#==============================================================================
# post-checkout hook
# 브랜치 체크아웃 시 core.hooksPath 자동 설정
# clone/checkout 후 .githooks 디렉토리가 있으면 자동으로 hooksPath 설정
#==============================================================================
# post-checkout 파라미터: prev_HEAD, new_HEAD, branch_flag
# branch_flag=1: 브랜치 체크아웃, 0: 파일 체크아웃
BRANCH_FLAG="$3"
# 파일 체크아웃은 건너뜀
if [ "$BRANCH_FLAG" = "0" ]; then
exit 0
fi
# .githooks 디렉토리 존재 확인
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
if [ -d "${REPO_ROOT}/.githooks" ]; then
CURRENT_HOOKS_PATH=$(git config core.hooksPath 2>/dev/null || echo "")
if [ "$CURRENT_HOOKS_PATH" != ".githooks" ]; then
git config core.hooksPath .githooks
chmod +x "${REPO_ROOT}/.githooks/"* 2>/dev/null
fi
fi