Git Hooks 생성기

Git 훅 스크립트 생성

Runs before a commit is created

대용량 파일 방지MB

설치 방법

  1. .git/hooks/ 디렉토리에 파일 저장
  2. 실행 권한 부여: chmod +x 파일명
  3. 또는 Husky 사용 권장

Git Hooks Guide

What are Git Hooks?

Git hooks are scripts that Git executes before or after events such as commit, push, and merge. They allow you to automate tasks and enforce policies in your development workflow.

Hook Types

pre-commit

Runs before commit. Use for linting, formatting, and validation.

commit-msg

Validates commit message format (e.g., Conventional Commits).

pre-push

Runs before push. Use for tests and branch protection.

post-merge

Runs after merge. Use for auto npm install on package changes.

Manual Installation

# Navigate to hooks directory

cd .git/hooks

# Create hook file

touch pre-commit

# Make executable

chmod +x pre-commit

Using Husky (Recommended)

# Install husky

npm install husky --save-dev

# Initialize husky

npx husky init

# Add pre-commit hook

echo "npm run lint" > .husky/pre-commit

Related Tools

Developer Tools

개발자를 위한 80가지 이상의 무료 온라인 도구를 제공합니다. Base64, JSON, JWT, 정규식 등 필수 개발 도구를 한 곳에서.

Developer Tools © 2025. All rights reserved.

대부분의 도구는 브라우저에서 동작하며, 네트워크가 필요한 도구만 실행 시에 데이터가 전송됩니다.

Git Hooks Generator - Pre-commit, Pre-push Scripts | Developer Tools