.gitattributesã®eol=crlfã¯æ¹è¡ã³ã¼ããCRLFã«å¤æãã¦ãã§ãã¯ã¤ã³ãããã®ã§ã¯ãªã
https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
eol
This attribute sets a specific line-ending style to be used in the working directory. It enables end-of-line normalization without any content checks, effectively setting the text attribute.
Set to string value "crlf"
This setting forces git to normalize line endings for this file on checkin and convert them to CRLF when the file is checked out.
Set to string value "lf"
This setting forces git to normalize line endings to LF on checkin and prevents conversion to CRLF when the file is checked out.
eol=lfããæ¹è¡ã³ã¼ããLFã«æ£è¦åãã¦ãã§ãã¯ã¤ã³ãããã¨æè¨ãã¦ããã®ã«å¯¾ããeol=crlfã¯ãæ¹è¡ã³ã¼ããæ£è¦åãã¦ãã§ãã¯ã¤ã³ãããã¨ããè¨ã£ã¦ããªããããã¾ã§ãããã§ãã¯ã¢ã¦ãæã«CRLFã«å¤æãããæ©è½ãªã®ã§ããªãã¸ããªã«CRLFã§æ ¼ç´ãããã¨ãå¼·å¶ããç¨éã§ä½¿ããã¨ã¯ã§ããªãã
以ä¸ã¯TortoiseGit 1.8.2.0(git version 1.7.11.msysgit.1)ã«ãããåä½ç¢ºèªè¨é²ã
ã.gitattributesããåå¨ããããcore.autocrlf=falseããè¨å®ããã¦ãããªãã¸ããªã§ã¯ãããã¹ããã¡ã¤ã«ã¯ä»¥ä¸ã®ããã«æ±ãããã
- æ¹è¡ã³ã¼ã LF ã®ãã¡ã¤ã«ã追å ããã¨ããªãã¸ããªã«ã¯æ¹è¡ã³ã¼ã LF ã®ã¾ã¾ã³ãããããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ã追å ããã¨ããªãã¸ããªã«ã¯æ¹è¡ã³ã¼ã CRLF ã®ã¾ã¾ã³ãããããã
- æ¹è¡ã³ã¼ã LF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ãããã¨ãä½æ¥ããªã¼ã«ã¯æ¹è¡ã³ã¼ã LF ã®ã¾ã¾ãã§ãã¯ã¢ã¦ãããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ãããã¨ãä½æ¥ããªã¼ã«ã¯æ¹è¡ã³ã¼ã CRLF ã®ã¾ã¾ãã§ãã¯ã¢ã¦ãããã
ã.gitattributesããåå¨ããããcore.autocrlf=trueããè¨å®ããã¦ãããªãã¸ããªã§ã¯ãããã¹ããã¡ã¤ã«ã¯ä»¥ä¸ã®ããã«æ±ãããã
- æ¹è¡ã³ã¼ã LF ã®ãã¡ã¤ã«ã追å ããã¨ããªãã¸ããªã«ã¯æ¹è¡ã³ã¼ã LF ã®ã¾ã¾ã³ãããããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ã追å ããã¨ããªãã¸ããªã«ã¯æ¹è¡ã³ã¼ã LF ã§ã³ãããããã
- æ¹è¡ã³ã¼ã LF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ãããã¨ãä½æ¥ããªã¼ã«ã¯æ¹è¡ã³ã¼ã CRLF ã§ãã§ãã¯ã¢ã¦ãããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ãããã¨ãä½æ¥ããªã¼ã«ã¯æ¹è¡ã³ã¼ã CRLF ã®ã¾ã¾ãã§ãã¯ã¢ã¦ãããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ããã¦è¡ã追å ãã¦ã³ãããããã¨ããªãã¸ããªã«ã¯è¿½å ããè¡ãå«ãã¦æ¹è¡ã³ã¼ã CRLF ã®ã¾ã¾ã³ãããããã
ã.gitattributesãã§ãeol=crlfãæå®ããã¦ãããã¡ã¤ã«ã¯ããcore.autocrlfãã®è¨å®ã«ãããã以ä¸ã®ããã«æ±ãããã
- æ¹è¡ã³ã¼ã LF ã®ãã¡ã¤ã«ã追å ããã¨ããªãã¸ããªã«ã¯æ¹è¡ã³ã¼ã LF ã®ã¾ã¾ã³ãããããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ã追å ããã¨ããªãã¸ããªã«ã¯æ¹è¡ã³ã¼ã LF ã§ã³ãããããã
- æ¹è¡ã³ã¼ã LF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ãããã¨ãä½æ¥ããªã¼ã«ã¯æ¹è¡ã³ã¼ã CRLF ã§ãã§ãã¯ã¢ã¦ãããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ãããã¨ãä½æ¥ããªã¼ã«ã¯æ¹è¡ã³ã¼ã CRLF ã®ã¾ã¾ãã§ãã¯ã¢ã¦ãããã
- æ¹è¡ã³ã¼ã CRLF ã®ãã¡ã¤ã«ããã§ãã¯ã¢ã¦ããã¦è¡ã追å ãã¦ã³ãããããã¨ããªãã¸ããªã«ã¯å ¨è¡æ¹è¡ã³ã¼ã LF ã§ã³ãããããã
Windowsä¸ã§ãã§ãã¯ã¢ã¦ãããéçºè ãè¤æ°åå¨ããå ´åãcore.autocrlfãtrueã«ãã人ã¨falseã«ãã人ãæ··å¨ããã¨ããªãã¸ããªã«æ ¼ç´ããããã¡ã¤ã«ã®æ¹è¡ã³ã¼ããæ··å¨ãããã¨ã«ãªãã ã§ããã ãã.gitattributesãã§ãtext=autoããeol=crlfããæå®ãã¦æ£è¦åãå¼·å¶ããããã-textããæå®ãã¦æ£è¦åãããªããã¨ãå¼·å¶ãã¦ãããæ¹ãããããããã£ããããã