Rename a merged commit without losing that commit's parents

TL;DR: Is it possible to rename a commit from a merged (no fast forward merge) branch – without destroying history?

I want to rename a commit. Something like rebase --interactive HEAD~5. But I want to keep the HEADs in their current position. Rebase will flatten the log.

  • How to keep two master lines?
  • Git-Svn: Retain commit timestamp after dcommit
  • git proper way to fix topic after branch merge
  • How to tell `git diff <commit>` to diff untracked files that used to be tracked in `<commit>`?
  • Git - My branch is based off of an unwanted commit by mistake, how to fix
  • Resolve merge conflicts: Force overwrite all files
  • I’m using feature branches

    *   c3cb3ad - Merge branch 'featureX' into develop (15 minutes ago) <FOO>
    |\  
    | * d945c71 - Did stuff (17 minutes ago) <FOO>
    | * d4356f4 - inline commits are aweosm <FOO> (27 minutes ago) <LSC>
    |/  
    *   6ef9569 - bla bla bla
    

    This is how I git:

    ~/dev/foo/ (develop)$ git checkout -b featureX
    ~/dev/foo/ (featureX)$ git add foo.html
    ~/dev/foo/ (featureX)$ git commit -m "inline commits are aweosm"
    ~/dev/foo/ (featureX)$ git checkout develop
    ~/dev/foo/ (develop)$ git merge --no-ff featureX
    ~/dev/foo/ (develop)$ git branch -D featureX
    ~/dev/foo/ (develop)$ git add bar.html
    ~/dev/foo/ (develop)$ git commit -m "Lorem Ipsum"
    

    … oh crap. There’s a typo in my commit message!

  • How to rebase in IntelliJ IDEA
  • How to handle elastic beanstalk deployment so it uploads only changed files
  • JGit Clone and get the revision hash
  • TortoiseGit - Revert?
  • How two people can commit in a particular PR
  • Mechanism behind packed files
  • One Solution collect form web for “Rename a merged commit without losing that commit's parents”

    Use git rebase with --preserve-merges

    Git Baby is a git and github fan, let's start git clone.