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)
$ # 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
masterand won't conflict with a dry merge
.sqwishedbranch based off of
- Copy state of files from original branch to
- Collect commit messages from original branch into collective commit message
messagewas not provided, open
commitprompt with collective message
- Commit changes to
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 --me
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.