git-sqwish 
Squash commits without repetitive conflicts
Designed for use with git merge during development and avoid git rebase's repetitive conflicts altogether.
Installation
One line install:
(cd /tmp && git clone --depth 1 https://github.com/twolfson/git-sqwish && cd git-sqwish && sudo make install)Manual install:
$ # Clone the repository
$ git clone --depth 1 https://github.com/twolfson/git-sqwish
Cloning into 'git-sqwish'...
...
Resolving deltas: 100% (13/13), done.
$ # Go into the directory
$ cd git-sqwish
$ # Install the script
$ sudo make install
... installing bins to /usr/local/bin
... installing man pages to /usr/local/share/man/man1
... installing git-sqwish
cp -f man/git-*.1 "/usr/local/share/man/man1"
cp -f etc/bash_completion.sh /etc/bash_completion.d/git-sqwish
$ git sqwish # Now available for invocationArchitecture
git-sqwish takes the same vision as your normal squash technique (git rebase + git rebase -i). The end goal is to have all applied changes on top of the latest master branch. The high level details are:
- Verify current branch is clean
- Verify current branch is ahead of
masterand won't conflict with a dry merge - Checkout
.sqwishedbranch based off ofmaster - Copy state of files from original branch to
.sqwishedbranch - Collect commit messages from original branch into collective commit message
- If
messagewas not provided, opencommitprompt with collective message - Commit changes to
.sqwishedbranch
FAQs
Can we squash changes without moving to a new branch?
A secondary branch is always required for this approach. However, git-extras implements a git-squash that returns to the original branch.
git squash --meAttribution
man/Readme.md, man/manning-up.sh, and Makefile are forked from git-extras, a broader collection of git utilities. Those files are licensed under the MIT License.
Donating
Support this project and others by twolfson via gittip.
Unlicense
As of Sep 24 2013, Todd Wolfson has released this repository and its unattributed contents to the public domain.
It has been released under the UNLICENSE.


