NotionCommotion Posted March 13, 2019 Share Posted March 13, 2019 My IDE (Nusphere's PhpED) runs on Windows but is configured so that both the web server as well as all project files are located on a development Linux server. Since the project files are located on the Linux server, the git repository is located there as well and not on my PC. Every now again, my IDE complains that content was externally modified and whether I wish to reload the file. Also, I was recently asked to set git's core.autocrlf to true on a project I was collaborating on which prevented me from adding any changes to git (git complained that LF will be replaced by CRLF). The IDE allows file encoding to be changed (system default, UTF-8, Windows-1252, or ISO-8859-01) as well as the default file format (Unix, Windows, Mac, or autodetect). Any recommendations on how best to configure git and these ide settings? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/308456-git-windows-linux-and-end-of-line/ Share on other sites More sharing options...
requinix Posted March 13, 2019 Share Posted March 13, 2019 Reminder that when core.autocrlf controls when Git converts line endings: - true = CRLFs in your working directory, LFs in the repository - input = whichever in your working directory, LFs in the repository - false = no conversions For the project you were contributing towards, if they asked for core.autocrlf=true then they want LFs in their code. That means you need either the "true" or "input" settings, depending whether you care about having CRLFs in your working directory. That's only ever useful if you want to open or edit a file in a dumb editor - which used to be Notepad, but since the October update that's finally no longer the case. So I would use core.autocrlf=input - LFs normally but with graceful handling of CRLFs. If you're the only developer then it doesn't really matter, but most people use LFs. Quote Link to comment https://forums.phpfreaks.com/topic/308456-git-windows-linux-and-end-of-line/#findComment-1565208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.