- .claude/rules/: 팀 정책, Git 워크플로우, 코드 스타일, 네이밍, 테스트 규칙 - .claude/skills/: init-project, sync-team-workflow, create-mr, fix-issue - .claude/settings.json: deny 규칙 + hooks - .claude/workflow-version.json: v1.2.0 적용 - .githooks/: commit-msg(grep -P→-E macOS 호환), pre-commit, post-checkout - .editorconfig, .sdkmanrc, .mvn/settings.xml (Nexus 미러) - .gitignore: .claude/ 팀 파일 추적 전환 - CLAUDE.md: 프로젝트 루트로 이동 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
942 B
Bash
Executable File
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
|