Skip to content
GitTree
History and recovery

Change selected local commits

For one quick change to history, you do not need the whole interactive rebase editor. A commit’s Edit History menu edits its message, drops it, or moves it up or down; selecting several commits opens the Squash dialog. GitTree rewrites the commits above it and keeps the old branch, so Undo puts it back.

FreeUpdated

Works in GitTree Free: every local Git feature, once you are signed in.

On this page
  1. Before you start
  2. Where to find it
  3. Steps
  4. Expected result
  5. Bigger changes
  6. If something goes wrong
  7. Questions
  8. Related

Before you start

  • The commits are on your current branch and, ideally, not pushed yet: they get new ids.

Where to find it

  • Right-click a commit: Edit History › Edit Commit Message…, Drop Commit…, Move Commit Up, Move Commit Down.
  • Select several commits, right-click: Squash Commits… (Squash commits covers every way to squash).
ActionmacOSWindows and Linux
Undo a history edit⌘ZCtrl+Z

Steps

  1. Edit a message

    Choose Edit Commit Message…. Edit Message of … says that this commit and every commit above it get new ids. Change the Message and press Save Message.

  2. Drop a commit

    Choose Drop Commit…. The commit is left out of the branch; the old branch is kept. Confirm with Drop Commit.

  3. Move a commit

    Move Commit Up or Move Commit Down swaps it with its neighbour.

  4. Squash several

    Select commits in one unbroken line and choose Squash Commits…. The Squash dialog shows the result, the message and who gets credit; confirm and they become one commit.

Expected result

GitTree says Commit message changed., Commit dropped. Undo can bring it back., Commit moved. or, for a squash, 3 commits squashed into a1b2c3d.

Bigger changes

For several changes at once, such as squashing some commits and rewording others, use the interactive rebase editor. To change only the last commit, amend it.

If something goes wrong

“A commit message cannot be empty.”

Type at least a summary line.

The edit is not available on a merge commit

These edits rewrite linear history. Merge commits cannot be reworded, dropped or moved this way.

Questions

Can I get a dropped commit back?

Yes. Press Undo in the toolbar; the old branch is also kept under refs/ogt/trash.