# fatal: protocol error: bad pack header

**Code:** `fatal: protocol error: bad pack header` · **Category:** Git · **Seen on:** Git

Git received garbage instead of a pack, from a proxy or broken server.

## Meaning

A proxy/firewall/ssh banner can inject text. Check `~/.bashrc` outputs on the SSH server (they corrupt the stream), proxies and try another protocol.

## Common causes

- Shell startup prints text on SSH server
- Proxy injecting content
- Server error

## Quick fix

1. Remove echo/output from remote shell profile
2. Try HTTPS vs SSH
3. Test without proxy

## Detailed fix by platform

### Shell

1. `ssh git@host true | wc -c   # should output nothing`

## How to diagnose

1. **Remote shell** — prints?
2. **Proxy** — involved?
3. **Protocol** — other works?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/git/protocol-bad-pack-header)
