H
H
Holfamer2015-02-16 15:44:13
git
Holfamer, 2015-02-16 15:44:13

What is core.autocrlf and core.safecrlf?

Please explain the purpose of these commands below with different options. How do they work?
core.autocrlf true (false, inline)
core.safecrlf true (false, warn)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Holfamer, 2015-02-16
@Holfamer

Setting core.autocrlf with "true" and "input" makes all line translations of text files in the main repository the same.
core.autocrlf true - git automatically converts CRLF->LF on commit and back to LF->CRLF when checking out code from the repository to the file system (used on Windows).
core.autocrlf input - convert CRLF to LF on commits only (used on Mac/Linux).
If core.safecrlf is set to "true" or "warm", Git checks if the transformation is reversible for the current core.autocrlf setting.
core.safecrlf true - rejects irreversible lf<->crlf conversion. Useful when specific binaries look like text files.
core.safecrlf warn - Print only a warning, but accept an irreversible transition.
More complete info:
core.autocrlf
core.safecrlf

R
ranebull, 2015-02-16
@ranebull

Using Git. AutoCRL Setting
Git core.safecrlf different behavior on files with...
[Git][CRLF and LF] Explain on fingers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question