Fix characters appearing in org files
So I was storing some .org files on windows machine and making a symlink from nixos - notes -> mnt/c/Users/arvydas/OneDrive/Documents/GIT/notes.
So basically stored files on Windows and used them in WSL(nixos). Did all the commits to those files from nixos also.
One day I have opened magi and wanted to check untracked files - there were hundreds of them, because each file had ^M character added to them. They were invisible in the .org file, but visible in git.
Researched a bit, saw these:
- https://stackoverflow.com/questions/1822849/what-are-these-ms-that-keep-showing-up-in-my-files-in-emacs
- https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
- https://stackoverflow.com/questions/9225599/should-git-change-the-ending-of-line-controlm-or-m-at-the-end-of-the-first-l
At first I thought it was an Emacs thing, but apparently it is Git thing. So adding this line to my terminal once:
git config --global core.autocrlf input
Has fixed the problem. The ^M's are now ignored and I can see the actual changes to the files.
Yay!