I wrote a power shell script specifically just to change CRLF to LF line endings that github windows app automatically adds to every commit. They created an entire windows app for Github but couldn't bother to allow an option to keep LF line ending formatting only for contributing to linux based file systems. I run WSL so switching back and forth was causing a windows/linux dev environment issue that drove me insane.
It only works for the first session then ignores your attributes. That was a deeper part of the problem.
I'm quoting myself from April 2024.
There are workarounds published online that include changing an environment variable and global git config. That workaround only works for 1 session, as soon as you close Github Desktop it will promptly ignore your previous changes. There are hundreds of issues filed about this in the Github Desktop repo over the past decade with no real solution.
My published article on Adafruit about the issue. I was contributing to Adafruit at the time who required Pylint, pre-commit, black, reuse, and other custom linting scripts. If you didn't pass the linting check you couldn't commit and that included using LF line endings otherwise Pylint & Black would throw thousands or tens of thousands of errors.
$ git config --global core.autocrlf true
# Configure Git to ensure line endings in files you checkout are correct for Windows.
# For compatibility, line endings are converted to Unix style when you commit files.
I agree but I liked having the IDE separate for reasons that are harder to explain. I found Github desktop easier to use. The downside is far less control. There are some things you simply cannot do with Github desktop.
My preferred IDE is actually Mu or Notepad++ and Git integration is either non-existent or severly lacking with lightweight IDE's. Because I was coding for micro-controllers I found PyCharm and other IDE's inefficient for fast work. I tried many different IDE's. Without going into the nuance of connecting via serial or web serial I'll just say that the smaller IDE's work better for that environment. For main C Python, completely different story, PyCharm works great with Git for Python. It's because of the micro-controller architectures and connecting (more importantly holding that connection) that changes the equation for what I believe was the most efficient workflow for me.
View all comments
5
u/DJDevon3 7d ago
I wrote a power shell script specifically just to change CRLF to LF line endings that github windows app automatically adds to every commit. They created an entire windows app for Github but couldn't bother to allow an option to keep LF line ending formatting only for contributing to linux based file systems. I run WSL so switching back and forth was causing a windows/linux dev environment issue that drove me insane.