You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2019/06/07 20:48:02 UTC
[cordova-contribute] 01/01: Create git-line-endings-on-windows.md
This is an automated email from the ASF dual-hosted git repository.
janpio pushed a commit to branch janpio-git_line_endings
in repository https://gitbox.apache.org/repos/asf/cordova-contribute.git
commit 4d093f3d321b89047246492fff0552c7d4343316
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Fri Jun 7 22:47:55 2019 +0200
Create git-line-endings-on-windows.md
---
git-line-endings-on-windows.md | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/git-line-endings-on-windows.md b/git-line-endings-on-windows.md
new file mode 100644
index 0000000..3b08b9d
--- /dev/null
+++ b/git-line-endings-on-windows.md
@@ -0,0 +1,18 @@
+# Git and File Line Endings on Windows
+
+LF only in all Cordova Repositories (execption `cordova-windows`)
+
+usually `git config --global core.autocrlf true` is a great solution: CRLF on Windows working copy (checkout), but LF everywhere else.
+breaks down when using working copy to create a release with e.g. `npm pack` or similar.
+
+Solution: `.gitattributes` with `* text eol=lf`. Tells git to always use LF, also on Windows.
+Caution: Files created locally with CRLF stay that way locally.
+
+Fix automatically:
+Commit everything, delete everything but `.git`, `git reset`.
+
+Fix manually:
+Find files (and lines) that still have CRLF:
+`grep -Pnr --include=* --exclude-dir=\.git '\r$' .`
+`find . -not -type d -exec file "{}" ";" | grep CRLF` (Git bash on Windows)
+Convert: `dos2unix`
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org