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.
Works in GitTree Free: every local Git feature, once you are signed in.
On this page
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).
| Action | macOS | Windows and Linux |
|---|---|---|
| Undo a history edit | ⌘Z | Ctrl+Z |
Steps
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.
Drop a commit
Choose Drop Commit…. The commit is left out of the branch; the old branch is kept. Confirm with Drop Commit.
Move a commit
Move Commit Up or Move Commit Down swaps it with its neighbour.
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.