Skip to content

Installation

git-autosquash is distributed as a Python package and can be installed using several methods. Choose the one that best fits your workflow.

Requirements

  • Python 3.12 or higher
  • Git 2.20 or higher
  • A terminal that supports ANSI colors (most modern terminals)

Installation Methods

uv is a fast, modern Python package manager with excellent tool installation support:

uv tool install git-autosquash

Why uv?

  • Fastest Python package manager available
  • Built-in tool isolation like pipx
  • Excellent dependency resolution
  • Cross-platform compatibility
  • Easy to upgrade: uv tool upgrade git-autosquash

pipx

pipx creates isolated environments for each tool, avoiding dependency conflicts:

pipx install git-autosquash

Why pipx?

  • Installs tools in isolated environments
  • Automatically adds executables to your PATH
  • Easy to upgrade and uninstall
  • No conflicts with other Python packages

pip

If you prefer using pip directly:

pip install git-autosquash

Virtual Environment Recommended

If using pip, consider installing in a virtual environment to avoid conflicts:

python -m venv git-autosquash-env
source git-autosquash-env/bin/activate  # On Windows: git-autosquash-env\Scripts\activate
pip install git-autosquash

From Source

For development or latest features:

git clone https://github.com/andrewleech/git-autosquash.git
cd git-autosquash
uv sync --dev
uv run git-autosquash --help
git clone https://github.com/andrewleech/git-autosquash.git
cd git-autosquash
pip install -e .

Verification

Verify your installation by running:

git-autosquash --version

You should see output similar to:

git-autosquash 1.0.0

Test the help system:

git-autosquash --help

Git Integration

As a Git Subcommand

You can make git-autosquash available as a git subcommand by ensuring it's in your PATH (which the installation methods above handle automatically). Then you can use:

git autosquash

instead of:

git-autosquash

Shell Completion

Add to your ~/.bashrc:

eval "$(register-python-argcomplete git-autosquash)"

Add to your ~/.zshrc:

eval "$(register-python-argcomplete git-autosquash)"

register-python-argcomplete --shell fish git-autosquash > ~/.config/fish/completions/git-autosquash.fish

argcomplete Required

Shell completion requires the argcomplete package:

pipx inject git-autosquash argcomplete
# or
pip install argcomplete

Dependencies

git-autosquash automatically installs these dependencies:

  • Textual - Rich terminal user interface framework
  • Rich - Rich text and beautiful formatting in the terminal

System-Specific Notes

macOS

On macOS, you might need to install a more recent version of Git if using the system default:

# Using Homebrew
brew install git

# Or using MacPorts  
sudo port install git

Windows

git-autosquash works on Windows with:

  • Git for Windows (includes Git Bash)
  • Windows Terminal (recommended for best experience)
  • WSL (Windows Subsystem for Linux)

Linux

Most modern Linux distributions include compatible versions of Git and Python. If needed:

sudo apt update
sudo apt install git python3 python3-pip
sudo dnf install git python3 python3-pip
sudo pacman -S git python python-pip

Upgrading

pipx

pipx upgrade git-autosquash

pip

pip install --upgrade git-autosquash

uv

uv tool upgrade git-autosquash

Uninstallation

pipx

pipx uninstall git-autosquash

pip

pip uninstall git-autosquash

uv

uv tool uninstall git-autosquash

Troubleshooting

Command Not Found

If you get "command not found" after installation:

  1. Check your PATH: The installation location should be in your PATH
  2. Restart your terminal: Changes to PATH may require a new terminal session
  3. Verify installation: Run pip list | grep git-autosquash to confirm it's installed

Permission Errors

If you encounter permission errors:

  1. Use pipx instead of pip: pipx handles permissions automatically
  2. Use virtual environments: Avoid system-wide pip installations
  3. Check directory permissions: Ensure you can write to the installation directory

Import Errors

If you see import errors about missing modules:

  1. Check Python version: Ensure you're using Python 3.12 or higher
  2. Verify installation: Reinstall with pip install --force-reinstall git-autosquash
  3. Check dependencies: All dependencies should install automatically

For more troubleshooting help, see our Troubleshooting Guide.