Skip to content

Instantly share code, notes, and snippets.

@Aierbote
Last active August 27, 2024 09:40
Show Gist options
  • Save Aierbote/5bcd55bd9b1282817c0fe6494a5575f0 to your computer and use it in GitHub Desktop.
Save Aierbote/5bcd55bd9b1282817c0fe6494a5575f0 to your computer and use it in GitHub Desktop.
type(scope): title
# No more than 50 chars ##### 50 chars is here: #
# Leave a blank line between title ⤴️ and body ⤵️
### BODY
# Wrap at 72 chars ################################ 72 chars is here: #
### OPTIONAL
# Co-authored-by: name <[email protected]>
# with '#' will be ignored, and an empty message aborts the commit.
### TIPS
# use `cw` to delete word and switch to Edit Mode in vim
@Aierbote
Copy link
Author

Aierbote commented Aug 27, 2024

After setting it up correctly, your default go to command will be just git commit, bye bye -m "string", especially if you like special character in commit messages, without the annoying escaping character...

Tip

This one-line setup might come in handy

echo "type(scope): title\n\n# No more than 50 chars ##### 50 chars is here: #\n\n# Leave a blank line between title ⤴️ and body ⤵️\n### BODY\n\n# Wrap at 72 chars ################################ 72 chars is here: #\n\n### OPTIONAL\n# Co-authored-by: name <[email protected]>\n# with '#' will be ignored, and an empty message aborts the commit.\n\n### TIPS\n# use `cw` to delete word and switch to Edit Mode in vim" > ~/.gitmessage && git config --global commit.template ~/.gitmessage

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