简体   繁体   中英

How do you make git use CRLF in temporary files?

In Windows 7, git would open notepad, and it worked fine, as the temporary files that git created during eg. git commit or git rebase -i contained CRLF.

I am currently using the Windows 10 preview, and have set core.editor to notepad. However, the temporary files are being created with LF instead of CRLF, which notepad does not support.

On both platforms, I am using the Git Shell that GitHub for Windows gives you, set to Bash.

How do I make git use CRLF in temporary files, like it did on my Windows 7?

Ah, found the answer: GitHub for Windows includes a utility called gitpad which converts the file to CRLF and then calls notepad. This had been set as the EDITOR variable on my Windows 7 system, so it all worked transparently. Setting core.editor to gitpad on my Windows 10 system solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM