Squash commits without repetitive conflicts
Designed for use with git merge
during development and avoid git rebase
's repetitive conflicts altogether.
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 invocation
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
master
and won't conflict with a dry merge - Checkout
.sqwished
branch based off ofmaster
- Copy state of files from original branch to
.sqwished
branch - Collect commit messages from original branch into collective commit message
- If
message
was not provided, opencommit
prompt with collective message - Commit changes to
.sqwished
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 --me
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.
Support this project and others by twolfson via gittip.
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.