https://github.com/techgaun/git-squash
Git squash easy way
https://github.com/techgaun/git-squash
command-line git github squash-and-merge squash-commits
Last synced: 7 months ago
JSON representation
Git squash easy way
- Host: GitHub
- URL: https://github.com/techgaun/git-squash
- Owner: techgaun
- License: mit
- Created: 2020-10-20T18:08:24.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-22T20:26:21.000Z (about 5 years ago)
- Last Synced: 2025-03-26T06:34:36.675Z (8 months ago)
- Topics: command-line, git, github, squash-and-merge, squash-commits
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-squash
> Git squash easy way
This small script mimics what GitHub's [Squash portion](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-request-merges#squash-and-merge-your-pull-request-commits) does for their _Squash and merge_ option on a Pull Request. It basically means you can easily squash all your commits into a single commit with this script without having to deal with finding out the first commit on your current branch that does not exist on the target branch.
## Installation
- Download [git-squash](git-squash) and place it in a path that is in `$PATH`
### Global installation
```shell
sudo curl https://raw.githubusercontent.com/techgaun/git-squash/main/git-squash -o /usr/local/bin/git-squash && sudo chmod +x /usr/local/bin/git-squash
```
### Local installation
Assuming the local path ($HOME/.bin in this example) is in `$PATH`:
```shell
curl https://raw.githubusercontent.com/techgaun/git-squash/main/git-squash -o "${HOME}"/.bin/git-squash && chmod u+x "${HOME}"/.bin/git-squash
```
## Usage
- Make sure your current branch does not have merge conflicts with target branch
```shell
git merge main
git squash main
```
## Authors
- [techgaun](https://github.com/techgaun)