提交PR后修改commit message

有时自己的PR会因为commit message不合要求被commitlint卡住,这时用--amend修改成合要求commit message再强制更新到自己提交PR的分支就可以了。

# 用 --amend 更新 commit message
git commit --amend -m "新的commit message"

# 强制更新到提交 PR 的分支 (origin xxxxx)
git push --force-with-lease origin xxxxx

🐘在Mastodon中搜索https://emptystack.top/note/update_commit_message_in_pr以点赞、评论。