git push
built-in 86.4% Savings
357 Commands
17.3K Tokens saved
5 Tests
Install
Safety checks passed
Filter definition
# git-push.toml — Trivial filter (Level 1)
# Raw: 15 lines of "Enumerating objects...", "Counting objects...", etc.
# Filtered: "ok ✓ main" (1 line)
command = "git push"
description = "Strip transfer noise; show branch name or rejection details"
inject_path = true
# Check full output for special cases first
match_output = [
{ contains = "Everything up-to-date", output = "ok (up-to-date)" },
{ contains = "non-fast-forward", output = "✗ push rejected (try pulling first)" },
]
[on_success]
skip = [
"^Enumerating objects:",
"^Counting objects:",
"^Delta compression",
"^Compressing objects:",
"^Writing objects:",
"^Total \\d+",
"^remote:",
"^To ",
]
extract = { pattern = '(\S+)\s*->\s*(\S+)', output = "ok ✓ {2}" }
[on_failure]
skip = [
"^remote:\\s*$",
"^To ",
"^error: failed to push",
"^hint:",
]
tail = 10
Examples
failed push (no remote) passes through error lines
~45 tokens → ~45 tokens
Raw output
fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Filtered output
fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
rejected push shows pull hint
~104 tokens → ~9 tokens
(91% saved)
Raw output
To github.com:user/repo.git ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'github.com:user/repo.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. If you want to integrate the remote changes, hint: use 'git pull ...' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Filtered output
✗ push rejected (try pulling first)
rule violation shows compact error with details
~105 tokens → ~78 tokens
(26% saved)
Raw output
remote: error: GH013: Repository rule violations found for refs/heads/main. remote: Review all repository rules at https://github.com/mpecan/tokf/rules?ref=refs%2Fheads%2Fmain remote: remote: - Required status check "Check" is expected. remote: To github.com:mpecan/tokf.git ! [remote rejected] main -> main (push declined due to repository rule violations) error: failed to push some refs to 'github.com:mpecan/tokf.git'
Filtered output
remote: error: GH013: Repository rule violations found for refs/heads/main. remote: Review all repository rules at https://github.com/mpecan/tokf/rules?ref=refs%2Fheads%2Fmain remote: - Required status check "Check" is expected. ! [remote rejected] main -> main (push declined due to repository rule violations)
success extracts branch name
~97 tokens → ~2 tokens
(98% saved)
Raw output
Enumerating objects: 5, done. Counting objects: 100% (5/5), done. Delta compression using up to 8 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 312 bytes | 312.00 KiB/s, done. Total 3 (delta 2), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (2/2), completed with 2 local objects. To github.com:user/repo.git abc1234..def5678 main -> main
Filtered output
ok ✓ main
up-to-date push shows friendly message
~5 tokens → ~3 tokens
(40% saved)
Raw output
Everything up-to-date
Filtered output
ok (up-to-date)
Warning: Community filters are third-party code. Review the filter definition above before installing it in production environments.Browse all filters