Best Practices, gitignore & Hooks

💻 GitLesson 15Advanced

Maintaining clean commit records requires managing patterns inside .gitignore and running pre-commit validation tests with Git Hooks.

1 Ignoring Files & Hooks
Text — .gitignore Template
# Ignore node_modules dependency folder
node_modules/

# Ignore environment variable keys
.env

# Ignore system temporary files
.DS_Store
Thumbs.db

Git Hooks are scripts placed inside .git/hooks/ that trigger validations (like running linters or tests) before commit tasks execute.

2 Code Challenge
Challenge: Create a .gitignore file ignoring all files matching `.log` extensions, and confirm they do not show up when running git status.