core.autocrlf

Can git be configured to not perform autocrlf on certain files?

倖福魔咒の 提交于 2021-01-27 07:29:43
问题 I am using git on a Java project which is deployed to Windows, Linux, and Mac clients. For this Java project, I also maintain *.sh scripts for running the compiled binaries on Mac/Linux and .exe/ .bat files for running the compiled binaries on Windows. My development environment is Windows. Git's autocrlf feature is converting line terminators in my *.sh scripts to the Windows format, which renders them useless on Linux/Mac after deployment. I want to save them in the Unix format and have git

Can git be configured to not perform autocrlf on certain files?

社会主义新天地 提交于 2021-01-27 07:29:25
问题 I am using git on a Java project which is deployed to Windows, Linux, and Mac clients. For this Java project, I also maintain *.sh scripts for running the compiled binaries on Mac/Linux and .exe/ .bat files for running the compiled binaries on Windows. My development environment is Windows. Git's autocrlf feature is converting line terminators in my *.sh scripts to the Windows format, which renders them useless on Linux/Mac after deployment. I want to save them in the Unix format and have git

Can git be configured to not perform autocrlf on certain files?

◇◆丶佛笑我妖孽 提交于 2021-01-27 07:26:13
问题 I am using git on a Java project which is deployed to Windows, Linux, and Mac clients. For this Java project, I also maintain *.sh scripts for running the compiled binaries on Mac/Linux and .exe/ .bat files for running the compiled binaries on Windows. My development environment is Windows. Git's autocrlf feature is converting line terminators in my *.sh scripts to the Windows format, which renders them useless on Linux/Mac after deployment. I want to save them in the Unix format and have git

Do I really need to specify all binary files in .gitattributes

喜夏-厌秋 提交于 2021-01-21 09:22:07
问题 I've read Git documentation that shows that I can explicitly set certain files to be treated as text, so their line endings are automatically changed or as binary to ensure that they are untouched. However, I have also read that Git is pretty good at detecting binary files, which makes me thing this is not needed. So my question is do I really need to specify these explicit settings for every single file extension in my repository? I've seen some recommend to do so for all image file

Line Endings: Git merge creates duplicates without conflict

こ雲淡風輕ζ 提交于 2020-01-01 16:59:47
问题 Git Auto Merge Issue: When there is Same code committed in two different branches file with one of this branch code having extra CRLF/LF at start. While merging it auto merges the file creates duplicates without any conflict. Please advise earliest. Below image shows all the possible symbols in text file. Note: Branch A does not have Line Feed(Line: 245). And Automated Merging below creates duplicates without showing conflict. 回答1: (Note: line endings are not the culprit here.) This case is

How to repair CRLF in GIT repository to avoid merge conflicts

泄露秘密 提交于 2019-12-30 05:58:24
问题 I created my repo with autocrlf=true and then made some checkouts and commits with autocrlf=false . Then switched back to autocrlf=true (OS Win). Everything seemed to be OK, until I started some merges between branches. Many merge conflicts arose, where whole file was marked as changed due to changed eols (I suppose it were those files, which were checked out and commited with autocrlf=false ). There is some history, which is worth for me, so I prefer to make some conversion or fixing commits

What does “check out code” mean in git documentation for line endings?

自闭症网瘾萝莉.ら 提交于 2019-12-22 12:43:08
问题 I'm really confused what "check out code" means in the following page: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#__code_core_autocrlf_code If you’re on a Windows machine, set it to true – this converts LF endings into CRLF when you check out code: Does it mean when you add files? Because whenever I change core.autocrlf from input to true and vice-versa, the differrence I see in when I add the files (does "check out" mean "add"?): > git config --global core.autocrlf true

git - CRLF issue in windows + linux dual boot

只愿长相守 提交于 2019-12-21 20:09:41
问题 I'm going to answer my question with the fix what solved my problem. Note for downvoters : I understand that the root cause is discussed in various other threads (that is how I solved my problem). This post is more about how having a dual boot system can lead you to this issue. So no, this question/answer is not a duplicate , but a particular instance of a general class of problems, adding more cases to SO's repository on this issue. At home : I code in Linux. LF used as line ending At the

Dealing with EOL characters in Cygwin Git and Git for Windows accessing the same repository

不打扰是莪最后的温柔 提交于 2019-12-21 12:37:31
问题 My autocrlf is equal to true. In my cygwin-shell git status gives me a correct list of all my changes. In Git Bash git status says I modified all files in the project. I also see this in Git GUI and the Changes-tab in IntelliJ. How is this possible, and more importantly, how can I fix it? 回答1: Cygwin Git "sees the world" as if it runs on a POSIX platform—thanks to the emulation provided by Cygwin. Contrary to this, Git for Windows is a native Windows program which does not use any emulation

Git core.safecrlf different behavior on files with same line endings

北慕城南 提交于 2019-12-20 08:45:34
问题 I have Windows machine with VS project and I use both Visual Studio and tools from Cygwin environment including Git. Sometimes I get different line endings in files after editing. I want simple solution to check files' line ending consistency before they go to the repo. Git's core.safecrlf is the right thing I suppose. Now I have a strange behavior: Files A and B with following parameters: $file A A: HTML document, UTF-8 Unicode text, with CRLF line terminators $file B B: HTML document, UTF-8