PU

push-large-git-histories

Tools to manage and push large Git branches without hitting provider limits.

Install

mkdir -p .claude/skills/push-large-git-histories && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12646" && unzip -o skill.zip -d .claude/skills/push-large-git-histories && rm skill.zip

Installs to .claude/skills/push-large-git-histories

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Push large Git branches and repositories to remotes when normal pushes stall, time out, or hit provider size limits. Use when Codex must move a local branch to a remote exactly, batch existing commits forward, diagnose oversized blobs, decide whether Git LFS is required, and verify that local and remote refs end at the intended commit.
337 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Push large Git branches to remotes.
  • Diagnose oversized blobs preventing pushes.
  • Batch existing commits forward.
  • Decide if Git LFS is required.
  • Verify local and remote reference integrity.

How it works

The skill identifies the push type, determines user constraints, and applies the least invasive path (direct, batched, or LFS migration) to push large Git histories, verifying remote refs at each step.

Inputs & outputs

You give it
A local Git branch to push.
You get back
A successfully pushed branch, or a report on push issues and mitigation steps.

When to use push-large-git-histories

  • Pushing a large repository that times out
  • Diagnosing large blobs preventing a push
  • Batching commits to bypass size limits
  • Syncing local branches with Git LFS

About this skill

Push Large Git Histories

Overview

Use this skill to push difficult Git branches without guessing. Start by identifying whether the job is:

  • a direct push of existing history
  • a batched push through the existing commit chain
  • a content-preserving sync that may require Git LFS or another size-handling change

Read references/playbook.md when you need exact commands, large-blob diagnostics, or PowerShell-friendly batching patterns.

Workflow

  1. Read current state from Git before deciding anything.
  2. Determine the user's hard constraints:
    • exact history must be preserved
    • content/state must match, but history rewrite is acceptable
    • force-push is allowed or forbidden
  3. Prefer the least invasive successful path:
    • direct exact refspec push first
    • batched exact refspec pushes next if the history itself is acceptable
    • LFS migration or other size-handling repair only when the user allows it
  4. Verify the remote ref after each important step with git ls-remote.

Required Checks

Always gather these before pushing:

git status --short --branch
git rev-parse refs/heads/<local-branch>
git ls-remote <remote> refs/heads/<remote-branch>
git log --oneline --reverse <remote>/<remote-branch>..<local-branch>

If the local and remote refs are already equal, stop and report that nothing needs pushing.

Direct Push

Prefer an exact refspec push instead of relying on inferred branch names:

git push --progress <remote> refs/heads/<local-branch>:refs/heads/<remote-branch>

Use this first when:

  • local history is a normal fast-forward of the remote
  • there is no evidence of large-object rejection
  • the user has not asked for special handling

Batch Existing History

If a full push stalls or times out, batch the already-existing local commit chain forward without inventing a replacement history.

Rules:

  • Push only commits that already exist on the local branch.
  • Push them in chronological order.
  • Use exact refspecs like <sha>:refs/heads/<remote-branch>.
  • Check the remote SHA after every successful step.
  • Finish with a final exact branch refspec push.

Use this only when:

  • the user wants the current local history preserved
  • the problem is transfer size, pack time, or flaky transport
  • GitHub or another remote has not rejected the history because of forbidden blob sizes

Diagnose Oversized Objects

If the remote rejects the push, identify whether the branch contains blobs above provider policy limits.

Check the ahead-range objects first:

git rev-list --objects <remote>/<remote-branch>..<local-branch> |
  git cat-file --batch-check="%(objecttype) %(objectname) %(objectsize) %(rest)"

If needed, filter for large blobs and map object IDs back to file paths. Use the playbook reference for a ready-made PowerShell pipeline.

LFS Boundary

Do not assume batching can solve every large push. Batching helps with large transfers, but it does not bypass provider blob-size policy.

If the existing history contains blobs over the remote's hard limit:

  • stop immediately if the user required exact existing history
  • report the offending blob and file path
  • state plainly that pushing the branch as-is is impossible to that remote without history changes

If the user only cares about the current codebase state matching remotely, and they allow history changes, Git LFS migration is a valid repair. In that case:

  • create a safety branch first
  • migrate the offending paths to LFS
  • verify the oversized Git blobs are gone from the branch's ahead-range
  • push with --force-with-lease, not blind --force

Verification

Success means all three refs agree:

git rev-parse refs/heads/<local-branch>
git rev-parse refs/remotes/<remote>/<remote-branch>
git ls-remote <remote> refs/heads/<remote-branch>

Also confirm:

git status --short --branch

The expected end state is that the local branch and its remote-tracking branch are up to date, or any remaining divergence is explicitly explained.

Reporting

When done, report:

  • the final local branch SHA
  • the final remote branch SHA
  • whether history was preserved or rewritten
  • whether Git LFS was introduced
  • any remaining warnings such as files above recommended but not blocked limits

When not to use it

  • When normal Git pushes are successful.
  • When the user requires exact existing history and the branch contains blobs over the remote's hard limit.

Limitations

  • Batching helps with large transfers but does not bypass provider blob-size policy.
  • If the existing history contains blobs over the remote's hard limit, pushing the branch as-is is impossible without history changes.
  • Requires user consent for history changes or LFS migration.

How it compares

This skill provides a structured approach to pushing large Git histories by diagnosing issues and offering specific strategies like batching or LFS migration, unlike attempting a simple `git push` repeatedly.

Compared to similar skills

push-large-git-histories side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
push-large-git-histories (this skill)04moNo flagsAdvanced
glab63moReviewIntermediate
bash-linux76moReviewIntermediate
azure-devops-cli45moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

glab

NikiforovAll

Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.

664

bash-linux

davila7

Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.

753

azure-devops-cli

github

Manage Azure DevOps resources via CLI including projects, repos, pipelines, builds, pull requests, work items, artifacts, and service endpoints. Use when working with Azure DevOps, az commands, devops automation, CI/CD, or when user mentions Azure DevOps CLI.

436

gitlab-ci-patterns

wshobson

Build GitLab CI/CD pipelines with multi-stage workflows, caching, and distributed runners for scalable automation. Use when implementing GitLab CI/CD, optimizing pipeline performance, or setting up automated testing and deployment.

1030

create-worktree-skill

disler

Use when the user explicitly asks for a SKILL to create a worktree. If the user does not mention "skill" or explicitly request skill invocation, do NOT trigger this. Only use when user says things like "use a skill to create a worktree" or "invoke the worktree skill". Creates isolated git worktrees with parallel-running configuration.

213

domain-dns-ops

steipete

Domain/DNS ops across Cloudflare, DNSimple, Namecheap for Peter. Use for onboarding zones to Cloudflare, flipping nameservers, setting redirects (Page Rules/Rulesets/Workers), updating redirect-worker mappings, and verifying DNS/HTTP. Source of truth: ~/Projects/manager.

27

Search skills

Search the agent skills registry