Skip to content

Ian729/git-squash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

git-squash

A simple and powerful Git plugin to squash your commits before creating a Pull Request.

This tool provides a unified interface to squash commits:

  • By base branch name (e.g., main, master)
  • By number of recent commits
  • By specific commit SHA

πŸš€ Installation

   brew install ian729/tap/git-squash

Usage

git squash <base-branch>
git squash <number-of-commits>
git squash --sha <commit-sha>

Examples

βœ… Squash all commits made since branching from main:

git squash main

βœ… Squash the last 3 commits:

git squash 3

βœ… Squash all commits made since a specific commit:

git squash --sha <commit-sha>

Note

  • This tool uses git reset --soft, preserving your working directory and staging area.

  • After squashing, use git push --force-with-lease to update the remote branch:

    git push --force-with-lease
  • Default commit message is Squashed commit, but you can provide a custom message during the prompt.

πŸ› οΈ Why use git-squash?

  • Keep your PR history clean.

  • Avoid git rebase -i complexity in simple squash workflows.

  • Fast, scriptable, and beginner-friendly.

πŸ“„ License

MIT License

About

A simple and powerful Git plugin to squash your commits before creating a Pull Request.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages