Skip to content

Splitting Commits with GitUp

Pierre-Olivier Latour edited this page Jan 19, 2017 · 3 revisions

Overview

One of GitUp's most powerful features, but still very intuitive, is commit splitting. Simply explained, it lets you take any commit and takes some of its changes (either entire files or just some lines) and "move" them from the "old" commit into a "new" commit.

Note that it's not possible to discard changes or add new ones. You can only move changes between the old and new commits.

Splitting in Action

Commit splitting does not modify your repository or working directory in any way until you finish. Just move the changes between the old and new commits and use the diff area to validate what each commit looks like.

When you are done, just click "Continue..." and provide commit messages for both commits, before finally confirming the split.

Mouse Interface

  • You can select multiple files in the "Old Commit" and "New Commit" file lists using Shift and Cmd (same as in standard Mac apps)
  • Move files by dragging them between the "Old Commit" and "New Commit" file lists
  • You can also double-click on files to move them

Keyboard Shortcuts

  • While in the splitting view:
  • Tab to switch between "Old Commit" and "New Commit" file lists
  • Arrow up & Arrow down to select a different file (combine with Shift to select multiple files)
  • Return to move the selected file(s) while in the "Old Commit" or "New Commit" file lists
  • Return to move the selected lines in the diff area
  • D to view the diffs for the selected file(s) with the external diff tool
  • Opt-Return to continue and enter the message view
  • While in the message view:
  • Tab to switch between the 2 message fields
  • Return to insert a newline in the commit message
  • Opt-Return to perform the commit
  • Esc to return to the splitting view

Tips

  • If you botched your commit splitting, just undo with Cmd-Z or from the "Edit" menu
  • You can view the diff for a specific file with the external diff tool using the action menu (gear icon)
  • You can resize the panes by putting your mouse over a divider and dragging

More Information

  • See this topic to learn more about the diff area