npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

git-auto-rebase-cli

v1.3.1

Published

A CLI tool that provides git automation commands including auto-rebase and amend-push functionality

Readme

git-auto-rebase-cli

A CLI tool that provides git automation commands including auto-rebase and amend-push functionality.

Installation

npm install -g git-auto-rebase-cli

Usage

In any git repository directory, run:

Auto Rebase (default)

git-auto-rebase
# or explicitly
git-auto-rebase rebase

Amend and Push

git-auto-rebase amend
# or
git-auto-rebase amend-push

Commit and Auto Rebase

git-commit-auto-rebase "your commit message"

Auto Commit and Push

# First, stage your changes
git add .

# Auto generate commit message and push
git-auto-commit-push

# Or use custom commit message
git-auto-commit-push "your commit message"

# Or use the short alias
gacp "your commit message"
gacp  # Auto generate commit message

Help

git-auto-rebase --help
# or
git-auto-rebase -h

What it does

Auto Rebase Command (rebase)

  1. Checks if you're in a git repository
  2. Verifies working directory is clean (no uncommitted changes)
  3. Gets current branch name
  4. Switches to main branch
  5. Pulls latest changes from origin/main
  6. Switches back to your original branch
  7. Rebases your branch onto main
  8. Pushes changes with --force-with-lease

Amend and Push Command (amend)

  1. Checks if you're in a git repository
  2. Gets current branch name
  3. Prevents execution on main branch for safety
  4. Amends the last commit without editing the message (git commit --amend --no-edit)
  5. Pushes changes with --force-with-lease

Commit and Auto Rebase Command (git-commit-auto-rebase)

  1. Checks if you're in a git repository
  2. Gets current branch name
  3. Prevents execution on main branch for safety
  4. Commits changes with provided message (git commit -m "message")
  5. Pushes changes to remote (git push)
  6. Switches to main branch
  7. Pulls latest changes from origin/main
  8. Switches back to your original branch
  9. Rebases your branch onto main
  10. Pushes changes with --force-with-lease

Auto Commit and Push Command (git-auto-commit-push)

  1. Checks if you're in a git repository
  2. Gets current branch name
  3. Checks if there are staged changes
  4. Auto-generates commit message based on staged files (or uses provided message)
  5. Commits changes (git commit -m "message")
  6. Pushes changes to remote (git push)

Note: You need to manually run git add before using this command.

Help Command (--help)

Displays usage information including:

  • Available commands and their descriptions
  • Usage examples
  • Safety features overview

Requirements

  • Node.js >= 12.0.0
  • Git repository
  • Clean working directory (no uncommitted changes)

Safety Features

  • Checks for uncommitted changes before proceeding (rebase command)
  • Uses --force-with-lease for safer force pushes
  • Prevents amend-push on main branch for safety
  • Error handling with clear messages
  • Exits gracefully if not in a git repository

Example Output

Auto Rebase

Starting git auto rebase...
Current branch: feature-branch
Checking if working directory is clean...
Switching to main branch...
Pulling latest changes from main...
Switching back to feature-branch branch...
Rebasing feature-branch onto main...
Pushing changes with force-with-lease...
Git auto rebase completed successfully!

Amend and Push

Starting git amend and push...
Current branch: feature-branch
Amending last commit without editing message...
Pushing changes with force-with-lease...
Git amend and push completed successfully!

Commit and Auto Rebase

Starting git commit auto rebase...
Current branch: feature-branch
Committing changes with message: "feat: add new feature"
Pushing changes...
Starting git auto rebase...
Current branch: feature-branch
Switching to main branch...
Pulling latest changes from main...
Switching back to feature-branch branch...
Rebasing feature-branch onto main...
Pushing changes with force-with-lease...
Git auto rebase completed successfully!

Auto Commit and Push

Starting auto commit and push...
Current branch: feature-branch
Generating commit message...
Generated message: "update src/index.js, src/utils.js"
Committing changes...
Pushing to remote...
Auto commit and push completed successfully!

Help Output

git-auto-rebase-cli v1.3.1

Usage:
  git-auto-rebase [command]
  git-commit-auto-rebase <commit message>
  git-auto-commit-push [commit message]

Commands:
  git-auto-rebase [command]
    rebase        Automatically rebase current branch onto main (default)
    amend         Amend last commit and force push with --force-with-lease
    amend-push    Same as amend
    --help, -h    Show this help message

  git-commit-auto-rebase <commit message>
    Commit staged changes with message, push, then auto rebase onto main
    Note: Cannot be used on main branch

  git-auto-commit-push [commit message]
    Auto commit staged changes and push to remote
    If no message provided, automatically generates commit message based on changes

Examples:
  git-auto-rebase                              # Run auto rebase (default)
  git-auto-rebase rebase                       # Run auto rebase explicitly
  git-auto-rebase amend                        # Amend last commit and push
  git-auto-rebase --help                       # Show this help
  git-commit-auto-rebase "fix: bug fix"        # Commit with message, push, then rebase
  git-auto-commit-push "feat: new feature"     # Commit and push with message
  git-auto-commit-push                         # Auto generate commit message and push

Safety Features:
  - Prevents amend/push operations on main branch
  - Uses --force-with-lease for safer force pushes
  - Checks for clean working directory before rebase
  - Comprehensive error handling

License

MIT