Skip to content
Squash-Push Icon
Fig. 02VS CODE EXTENSION

Squash-Push

Simplify your Git workflow by squashing multiple commits before pushing to a remote repository. This extension streamlines the development process and keeps your commit history clean.

Squash-Push Demo
Version 0.1.0
VS Code 1.60+
Git Workflow
Developer Productivity

Overview

Squash-Push is a Visual Studio Code extension I developed to address a common pain point in Git workflows. It simplifies the process of squashing multiple commits before pushing to a remote repository, making commit history cleaner and more organized without requiring complex Git command sequences.

Branch detection

Automatically identifies your current Git branch and its configuration

Commit listing

Lists local commits that have not been pushed yet

Interactive UI

Clean interface to select a base commit for squashing

One-step operation

Performs the squash operation with a single command

Usage guide

  1. Open a Git repository in VS Code
  2. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  3. Type “Squash Local Commits” or “Squash-Push: Squash Local Commits” and select the command
  4. Select the oldest commit you want to keep as the base for squashing
  5. The extension will squash your commits and open the commit message editor
  6. Save your new commit message and push your changes
Command
Squash-Push: Squash Local Commits

Requirements

  • Git must be installed and available in your PATH
  • VS Code 1.60+

Known limitations

May encounter issues with merge commits

Future plans

Squash-Push is under active development, with several planned enhancements to make Git workflow management even more efficient.

User experience

  • Custom commit message templates
  • Auto-push option after squashing
  • Undo squash operation

Technical enhancements

  • Support for multiple workspace folders
  • Interactive rebase option
  • Branch protection rules

Installation

  1. Launch VS Code
  2. Go to Extensions view (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for “Squash-Push”
  4. Click Install

Technical details

Squash-Push is built using the VS Code Extension API and implements Git operations through utility functions that integrate with VS Code UI components.

Core functions
  • execGitCommand
    Executes Git commands and returns results as promises
  • getCurrentBranch
    Gets the name of the current Git branch
  • getCurrentUpStreamBranch
    Determines the upstream branch for the current branch
  • getLocalCommits
    Retrieves a list of local commits
  • hasParent
    Checks if a commit has a parent commit
  • showCommitSelections
    Displays UI for selecting commits
  • getCommitID
    Extracts and validates the selected commit ID