---
title: "A script fails on your colleague's machine because its line endings changed | Proofline"
description: "When a script that works for you fails for the receiver with \"required file not found\" or a different hash, compare line endings first."
url: https://proofline.sh/learn/crlf-changes-in-handoff/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# A script fails on your colleague's machine because its line endings changed

When a script that works for you fails for the receiver with "required file not found" or a different hash, compare line endings first. The command git ls-files --eol shows what Git stores and what is on disk, and those can differ while git status is clean.

Broken dependencies The Proofline team November 24, 2026 3 min read

## Reproduce it

A checkout with `core.autocrlf=true` rewrites line endings. The repository stores `f.sh` with LF, and this clone converts it:

```
git -c core.autocrlf=true clone repo copy
```

|  | Original | Copy |
| --- | --- | --- |
| `file f.sh` | ASCII text | ASCII text, with CRLF line terminators |
| `sha256sum f.sh` | `911169dd…` | `58055bdc…` |
| `git ls-files --eol f.sh` |  | `i/lf w/crlf` |

The index has LF (`i/lf`) and the working tree has CRLF (`w/crlf`). Run with Git 2.43 on Linux. The `-c` option applied only to the clone command, so a later `git status` in that copy showed `M f.sh`. With the setting stored in the clone's configuration, `git status` printed nothing and the file still had CRLF on disk.

A shell script with a CRLF first line does not start:

```
/bin/bash: line 15: ./x.sh: cannot execute: required file not found
```

The exit status is 127. The kernel looks for an interpreter named `/bin/sh` followed by a carriage return. The message names the script, which plainly exists, so people check the path and the permissions first.

## Separate the causes

| Observation | Cause | Fix |
| --- | --- | --- |
| `i/lf w/crlf` | The receiver's checkout converts | Set the attribute below, then check out the file again |
| `i/crlf w/crlf` | CRLF was committed | Normalize once, in its own commit |
| `i/lf w/lf`, and the script still fails | Not line endings, or the copy that fails is not this file | Run `file` on the copy that fails |
| The file came by chat, email or a zip | Git was not involved | Compare hashes with the sender |

The third row matters for build contexts. A container image can hold a CRLF copy made on one machine while the repository is fine on another, so check the file inside the image.

## Make the repository decide

A `.gitattributes` entry takes the choice away from each person's configuration:

```
*.sh text eol=lf
*.bat text eol=crlf
*.png binary
```

The [gitattributes manual](https://git-scm.com/docs/gitattributes) describes `text` and `eol`, and gives `git add --renormalize .` for files already stored with the wrong endings. Commit the renormalization alone. It touches whole files and would hide a real change in the same diff.

## What to put in the handoff

Send the hash of the file you ran, not only its path: `sha256sum scripts/seed.sh`. A matching hash rules out line endings, encoding and an edited copy in one comparison. A different hash tells the receiver to look for conversion before reading the code.

## Worked example

This example is fictional. A QA engineer on Windows reports that `seed.sh` is missing inside a container that the developer built from the same commit. The developer's hash starts `911169dd` and the one inside the image starts `58055bdc`. `git ls-files --eol` on the QA machine prints `i/lf w/crlf`. The attribute line fixes the next checkout, and the bug report about a missing file is closed with the two hashes.

Files sent outside Git have more ways to change. Start from [handing over evidence](/learn/engineering-handoff-evidence/).

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Hand over uncommitted work without losing files](/learn/hand-over-uncommitted-changes/)
    
    Deployment failures The Proofline team November 24, 2026 3 min read
    
-   ### [Hand over enough evidence for the next engineer to decide](/learn/engineering-handoff-evidence/)
    
    Code review The Proofline team November 24, 2026 4 min read
