# GitHub Actions: Error: The process '/usr/bin/git' failed with exit code 128

**Code:** `The process '/usr/bin/git' failed with exit code 128` · **Category:** CI/CD · **Seen on:** GitHub Actions

A git command inside the workflow failed — usually authentication to a private repo/submodule, a missing ref, or pushing without permission.

## 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

1. Read the git error above the exit code
2. Pass token/ssh-key to actions/checkout for private submodules
3. Set fetch-depth: 0 when history/tags are needed

## Detailed fix by platform

### YAML

1. 

```yaml
- uses: actions/checkout@v4
  with:
    submodules: recursive
    token: ${{ secrets.SUBMODULES_PAT }}
    fetch-depth: 0
```


## How to diagnose

1. **Message** — Git error line
2. **Repo** — Private?
3. **Ref** — Exists?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cicd/git-failed-with-exit-code-128)
