Firstly make sure you're using a decent editor with your git e.g. Atom, VS Code etc.
git config --global core.editor "atom"
To modify a merge commit history, like the merges done by popular online version control systems such as GitLab or Bitbucket:
¢ git rebase --rebase-merges -i HEAD~1