How to remove a committed file from Git history forever git

How to remove a committed file from Git history forever

Committed an .env file with secrets to Git? Three steps remove it from history forever: add it to .gitignore, rewrite every commit with git filter-branch, then git push --force the cleaned history. Exact commands included, plus what the rewrite does to your repository.

Jan 8, 2024

Add commit message validator using Ruby and Lefthook ruby

Add commit message validator using Ruby and Lefthook

Enforce consistent commit messages with a small Ruby script and Lefthook: a commit-msg hook that reads .git/COMMIT_EDITMSG, validates prefixes like feat, fix, or docs against a regex, and rejects bad messages before they land. Full script and Lefthook config included.

Jan 1, 2024