momox
v1.0.7
Published
A tool kit for MoMo Handler
Readme
momox
A CLI tool for git operations, starting with squash for sprint branches.
Description
momox is a command-line tool designed to perform various git operations. Currently, it supports squashing commits on sprint feature branches into a single commit. It automatically determines the base branch based on the sprint date and performs a safe squash operation. Future versions will include additional commands like debug, monitor, etc.
Installation
Install globally via npm:
npm install -g momoxUsage
Navigate to your git repository and run:
npx momox squash [commit-message]Requirements
- Your current branch must follow the format:
sprint_YYYYMMDD/feature-name - The base branch
sprint_YYYYMMDD/mastermust exist on the remote. - You must be on a feature branch (not the master branch).
Examples
# Squash with default commit message (uses the latest commit message)
npx momox squash
# Squash with a custom commit message
npx momox squash "feat: implement user authentication"What it does
- Validates the current branch name format.
- Derives the base branch from the sprint date.
- Fetches the latest changes from origin.
- Pulls the latest changes from the remote branch.
- Creates a backup branch (e.g.,
branch_backup_20251230_123456) from the current state and pushes it to origin for safety. - Finds the merge-base between your branch and the base branch.
- Stashes any uncommitted changes if present.
- Resets softly to the merge-base.
- Commits all changes with the specified message.
- Restores stashed changes if any.
- Pushes the squashed branch with force-with-lease.
License
MoMo
