Skip to content

Notes for conventional commits requirements

Rand McKinney edited this page Apr 7, 2025 · 1 revision

Sometimes the conv. commits requirements can bite you. Here are some tips about how to fix things if you accidentally forget to prefix your commit message as required.

Change a single commit message

If you commited a change, but didn't yet push it up to GitHub, use this command to change the commit message:

git commit --amend

Change the commit message in the text editor.

If you did push the commit up to GitHub, then do the above PLUS:

git push --force-with-lease origin EXAMPLE-BRANCH

If you updated a branch from main before merging

The biggest offender for the commit messages is definitely the UI update branch in GitHub. Fix it like this:

git pull
git commit --amend
# Edit the commit message in vim editor and add proper prefix
git push --force