sheerun / git-squash

Locally squash commits on a branch without resolving any conflicts (a'la squash and merge)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git squash Maintenance

Locally squash commits on a branch, without needing to resolve any conflicts 🧈

It works just like GitHub's "Squash and merge" or GitLab's "Squash commits".

Installation

With Homebrew on MacOS and Linux:

brew install sheerun/git-squash/git-squash

With curl on MacOS and Linux, including Windows Subsystem for Linux:

curl https://raw.githubusercontent.com/sheerun/git-squash/master/git-squash > /usr/local/bin/git-squash && chmod a+x /usr/local/bin/git-squash

Usage

# This tool requires that target branch is mergable to current one
# The easiest way to ensure it is to merge it and resolve any conflicts
git merge master
# Squash all changes on current branch that happened since master branch
git squash master

License

MIT

About

Locally squash commits on a branch without resolving any conflicts (a'la squash and merge)

License:MIT License


Languages

Language:Shell 100.0%