Practical Git via GitExtensions
  • Git - a Distributed System
  • Bare Minimal Configurations
  • Creating a New Branch
  • Making a Commit
    • Adding only a portion of a file
    • Commit Message
    • Cherry-pick
    • Revert
  • Rewriting History
    • Rewording the Last Commit
    • Rewording Commit Message in Middle
    • Editing the Last Commit
    • Squashing Last Few Commits
    • Squashing Commits in Middle
    • Spliting Commit into Multiple
    • Removing a Commit
    • Pushing after Rewriting History
  • Lost and Found
  • Comparing Commits or Branches
  • Checking out a Branch into Another Folder
  • Blaming History
    • Blame
    • Bisect
  • Disabling Auto Tracking Branch
  • Line Ending
  • Ignore Unwanted Files
Powered by GitBook
On this page

Was this helpful?

  1. Rewriting History

Spliting Commit into Multiple

PreviousSquashing Commits in MiddleNextRemoving a Commit

Last updated 6 years ago

Was this helpful?

Let's say we want to split the WIP: Fix blah blah into multiple commits. We again right click the parent commit my awesome changes and start an interactive rebase.

This time we change the pick to e or edit

e d310b7c35 WIP: Fix blah blah
pick f3ee84093 WIP: Continue Fix blah blah
pick 07ec28ec2 Fix another stupid bug

After saved and closed, the GitExtensions may stop at the Rebase Dialog (which is not very friendly), we can safely close it.

Then it goes back to the main revision grid looks like below, also notice the message at the bottom right You are in middle of a rebase:

Now we can do a Mixed reset to the parent commit my awesome changes, and commit as many commits as we want. Once finished, click the bottom right You are in middle of a rebasemessage and press the Continue button to continue the rebase.

Note: there is also an Edit commit menu somewhere in GitExtensions but it is recommended that you use the interactive rebase to get yourself familar with it.