3 ms·
You can only edit any commit that's reachable from the current HEAD without checking it out. I.e. a commit that's in a branch that's not merged back into wherev
by kemayo 4y ago
You can only edit any commit that's reachable from the current HEAD without checking it out. I.e. a commit that's in a branch that's not merged back into wherever you currently are can't be edited.
(I made a test repo to check this, because it had actually never come up before in my day-to-day usage.)
- arxanas 4y agoThanks for pointing this out. I confirmed that you can reword a commit without checking it out, with the caveats: - It has to be an ancestor of `HEAD`, like you said. - Doing so doesn't invoke Git's `post-rewrite` hook, which can cause interoperability issues with other tools :( - Doing so will abandon at least some descendant branches (possibly all descendant branches which aren't checked out, or possibly just those which branch aren't ancestors of `HEAD`). - Doing so doesn't seem to be undoable inside Sublime Merge via the undo command.