GitButler ⧓

GuidesCLI Tutorial

Editing Commits

Editing commit messages and edit mode with GitButler.

While you can rub changes in and out of commits, you can also edit the commit message of any commit in your workspace quite easily.

Editing Commit Messages

You can edit commit messages with the but describe command. So if we have this status:

$ but status
╭┄zz [unstaged changes] 
┊     no changes
┊
┊╭┄us [user-bookmarks]  
┊●   464aae4 add user changes  
┊●   ca81308 create bookmarks  
├╯
┊
┊ 32a2175 (upstream) ⏫ 2 new commits 
├╯ 204e309 (common base) [origin/main] 2025-07-06 Merge pull request #10 from schacon/sc-description

Hint: run `but help` for all commands

Then you can edit the message of any commit by running but reword <sha>, which will open up your editor of choice with the existing commit message and when you exit the editor, replace that message in the commit and rebase everything above it.

The editor would look something like this:

add user changes

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Changes in this commit:
#       modified:   app/models/user.rb
#       modified:   config/routes.rb
#
~
~
~
~

Pretty simple.

Changing Branch Names

Just like changing commit messages, you can also use but reword to change the name of a branch. So, in the above example, if we wanted to change the branch name from user-bookmarks to feature-awesome-thing, we can do this:

$ but reword -m feature-awesome-thing us
Renamed branch 'user-bookmarks' to 'feature-awesome-thing'

Et voila.

$ but status
╭┄zz [unstaged changes] 
┊     no changes
┊
┊╭┄at [feature-awesome-thing]  
┊●   464aae4 add user changes  
┊●   ca81308 create bookmarks  
├╯
┊
┊ 32a2175 (upstream) ⏫ 2 new commits 
├╯ 204e309 (common base) [origin/main] 2025-07-06 Merge pull request #10 from schacon/sc-description

Hint: run `but help` for all commands

Last updated on

On this page

Edit on GitHubGive us feedback