summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2016-08-25 17:52:58 +0200
committerJunio C Hamano <gitster@pobox.com>2016-08-25 13:38:35 -0700
commit6c12979b659e1aa825c03b2c23073100bfd10992 (patch)
treecc0bde146a3490553f17dbb0c5ad99184bd5197a
parent41a616dadaf2a7445ea7c3f5d77a20337af4de90 (diff)
downloadgit-tb/eol-docs.tar.gz
gitattributes: Document the unified "auto" handlingtb/eol-docs
Update the documentation about text=auto: text=auto now follows the core.autocrlf handling when files are not normalized in the repository. For a cross platform project recommend the usage of attributes for line-ending conversions. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Documentation/gitattributes.txt24
1 files changed, 16 insertions, 8 deletions
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 807577a59f..4012661f62 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -213,27 +213,35 @@ that text files that you introduce to the repository have their line
endings normalized to LF when they are added, and that files that are
already normalized in the repository stay normalized.
+If you want to ensure that text files that any contributor introduces to
+the repository have their line endings normalized, you could set the
+`text` attribute to "auto" for _all_ files.
+
+------------------------
+* text=auto
+------------------------
+
If you want to interoperate with a source code management system that
enforces end-of-line normalization, or you simply want all text files
in your repository to be normalized, you should instead set the `text`
-attribute to "auto" for _all_ files.
+attribute to "text" for text files.
------------------------
-* text=auto
+*.txt text
------------------------
-This ensures that all files that Git considers to be text will have
+This ensures that all files marked as text will have
normalized (LF) line endings in the repository. The `core.eol`
configuration variable controls which line endings Git will use for
normalized files in your working directory; the default is to use the
native line ending for your platform, or CRLF if `core.autocrlf` is
set.
-NOTE: When `text=auto` normalization is enabled in an existing
-repository, any text files containing CRLFs should be normalized. If
-they are not they will be normalized the next time someone tries to
-change them, causing unfortunate misattribution. From a clean working
-directory:
+NOTE: When you have a cross-platform project using push and pull
+to a central repository the text files containing CRLFs should be
+normalized. All text files should have a text attribute, either
+`text` or `text=auto`.
+From a clean working directory:
-------------------------------------------------
$ echo "* text=auto" >>.gitattributes