Posted By

beneberle on 02/26/12



Versions (?)

Git Rebase and Squash

 / Published in: Bash


Combine multiple smaller incremental commits into larger ones, perfect for encouraging you to commit often while enabling you to summarize a day's work into one, or more, simplified commit.

WARNING: Only do this on commits that haven’t been pushed an external repository.

  1. git rebase -i HEAD~4
  3. # The ~4 in the command designates the number of commits that you wish to combine
  4. # the command will open up a text editor from wich you can choose which commits
  5. # to 'pick' and which to 'squash'. save and close, then you'll have a chance to edit
  6. # the individual commit messages. save and close that and you're done. squashed.

Report this snippet  

You need to login to post a comment.