# error: patch failed: src/app.js:12 error: src/app.js: patch does not apply

**Code:** `error: patch failed / patch does not apply` · **Category:** Git · **Seen on:** Git

A patch can't be applied cleanly to the current files.

## Meaning

The target file changed since the patch was made. Use `git apply --3way`, `git am -3` or `patch --merge`, or regenerate the patch from the current base.

## Common causes

- File changed since patch
- Wrong base commit
- Whitespace/line endings differ

## Quick fix

1. `git apply --3way patch.diff`
2. `git am -3 *.patch`
3. `--ignore-whitespace`

## Detailed fix by platform

### Git

1. `git apply --3way --ignore-whitespace fix.patch`

## How to diagnose

1. **Base** — same?
2. **EOL** — same?
3. **3way** — used?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/git/patch-does-not-apply-git-apply)
