How to enable signing commits in Git using GPG keys git

How to enable signing commits in Git using GPG keys

Signed Git commits set up in minutes: the modern SSH key method for git 2.34+, from gpg.format ssh config through adding your key on GitHub, so your commits get the Verified badge. Commands included for Mac and Linux.

Feb 19, 2024

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