Skip to content

Instantly share code, notes, and snippets.

@b3ll
Created September 22, 2023 16:19
Show Gist options
  • Save b3ll/1d594148739530fb9b4abe5ed2f5540f to your computer and use it in GitHub Desktop.
Save b3ll/1d594148739530fb9b4abe5ed2f5540f to your computer and use it in GitHub Desktop.
Reformat a git commit's title by running it through titlecase
#!/bin/bash
INPUT_FILE=$1
START_LINE=`head -n1 $INPUT_FILE`
FIXED_TITLE=`echo $START_LINE | titlecase`
sed -i '' "1s/$START_LINE/$FIXED_TITLE/" $INPUT_FILE
@b3ll
Copy link
Author

b3ll commented Sep 22, 2023

You'll want this as your commit-msg hook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment