# git-chunks > CLI that splits pending git changes into multiple commits (by max files > and/or working-tree size per commit) and optionally pushes after each one to > reduce push size and per-push scan/hook time. Works as a git subcommand: > `git chunks`. Non-interactive and resumable after push failures. Fixes errors like: - "remote: fatal: pack exceeds maximum allowed size" (GitHub) - "remote: GitLab: Push size limit exceeded" - "error: RPC failed; HTTP 413" / "HTTP 500" - "error VS403500: size of your push exceeds the limit" (Azure DevOps) - "remote: pre-receive hook declined" (timed-out server-side scan) Install: `npm i -g git-chunks` | `brew install jishnuteegala/tap/git-chunks` | `winget install jishnuteegala.git-chunks` | `go install github.com/jishnuteegala/git-chunks/cmd/git-chunks@latest` Common commands: - Preview plan (JSON): `git chunks --max-size 50M --dry-run --json` - Commit in chunks: `git chunks --max-files 100 --max-size 50M -m "import assets"` - Commit + push each: `git chunks --max-size 50M --push --retries 3 --log push.log` Behaviour notes: - At least one of --max-files / --max-size is required. - Progress goes to stderr; --dry-run plan goes to stdout. - Exit codes: 0 success, 1 runtime error, 2 usage error. - On push failure after retries, committed work is preserved; rerunning first pushes existing commits before creating another chunk. - A single file larger than --max-size still gets its own commit (files cannot be split; use Git LFS for files over the platform hard limit). - --max-size sums regular files' current on-disk working-tree sizes. It is not a guarantee of compressed Git pack or protocol size. - The index must be empty; staged changes are rejected before committing. - Use only in trusted repositories with trusted hooks, remotes, and credential helpers. Fix server policy findings rather than trying to bypass them. Docs: https://github.com/jishnuteegala/git-chunks