GitHub Actions: Error: The process '/usr/bin/git' failed with exit code 128
A git command inside the workflow failed — usually authentication to a private repo/submodule, a missing ref, or pushing without permission.
The process '/usr/bin/git' failed with exit code 128failed with exit code 128git failed with exit code 128 Meaning
Exit code 128 is git’s generic fatal error; the lines above show the reason: “Repository not found”, “could not read Username”, “couldn't find remote ref” or “Permission denied”.
Common causes
- Private submodule/repo needs a token or SSH key
- Branch/tag doesn’t exist (wrong ref)
- Push without contents: write
- Shallow clone missing history (fetch-depth)
⚡ Quick fix
- Read the git error above the exit code
- Pass token/ssh-key to actions/checkout for private submodules
- Set fetch-depth: 0 when history/tags are needed
Detailed fix by platform
YAML
- yaml
- uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.SUBMODULES_PAT }} fetch-depth: 0
How to diagnose
- Message — Git error line
- Repo — Private?
- Ref — Exists?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- couldn't find remote ref (checkout) GitHub Actions: fatal: couldn't find remote ref refs/heads/feature — The process '/usr/bin/git' failed with exit code 1 (actions/checkout)
- github-actions[bot] 403 remote: Permission to owner/repo.git denied to github-actions[bot]. fatal: unable to access … The requested URL returned error: 403
- npm git dependency error npm ERR! code 128 — An unknown git error occurred (git dependency install)
Most viewed in CI/CD
- Unable to download artifact GitHub Actions: Error: Unable to download artifact(s): Artifact not found for name: build
- .gitlab-ci.yml invalid GitLab CI: Found errors in your .gitlab-ci.yml: jobs:build config contains unknown keys: scripts
- Waiting for next available executor Jenkins: Still waiting to schedule task — Waiting for next available executor / 'agent1' is offline
Other ways to find it
Where this error sits
Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 12 Oct 2026