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.
Seen on:
GitHub Actions
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
- 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)
- publickey Git: Permission denied (publickey). fatal: Could not read from remote repository.
Other ways to find it
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026