Skip to content

balakumardev/github-pr-squasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

GitHub PR Squasher

A browser userscript that adds a "Squash & Recreate PR" button to GitHub pull requests. It creates a new PR with squashed commits while preserving the original description.

PR Squasher Button TODO

Features

  • ✨ One-click PR squashing
  • 📝 Preserves PR description
  • 🔄 Automatically closes original PR
  • 🗑️ Deletes original branch
  • 🔒 Secure token storage
  • ⏳ Progress indicators
  • 🏢 Supports GitHub Enterprise

Installation

Method 1: Greasy Fork (Recommended)

  1. Install a userscript manager:

  2. Install the script from Greasy Fork

Method 2: Manual Installation

  1. Install Tampermonkey from your browser's extension store
  2. Click github-pr-squasher.user.js in this repository
  3. Click the "Raw" button
  4. Tampermonkey should automatically detect and prompt you to install the script

Setup

  1. Generate a GitHub token:

  2. Configure the script:

    • Click the Tampermonkey icon in your browser
    • Select "Set GitHub Token"
    • Paste your token
    • For GitHub Enterprise users:
      • Select "Set Enterprise Domain"
      • Enter your GitHub Enterprise domain (e.g., github.mycompany.com)
    • Refresh GitHub

Usage

  1. Navigate to any GitHub pull request
  2. Look for the "Squash & Recreate PR" button next to the PR title
  3. Click the button
  4. The script will:
    • Create a new branch
    • Create a squashed commit
    • Create a new PR with the squashed changes
    • Preserve the original PR description
    • Close the original PR
    • Delete the original branch
    • Redirect you to the new PR

Development

To modify the script:

  1. Clone this repository
  2. Modify github-pr-squasher.user.js
  3. Test changes by loading the script in Tampermonkey
  4. Submit a PR with your changes

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE for details

Support

Changelog

v1.0.0 (2024-01-07)

  • Initial release
  • Basic squashing functionality
  • Token management
  • Progress indicators
  • Automatic branch deletion
  • GitHub Enterprise support

About

A userscript that adds a "Squash & Recreate PR" button to GitHub pull requests. It creates a new PR with squashed commits while preserving the original description.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors