in my repository i have several shell scripts that run in a cygwin console on windows machines. my problem is every time i update those files git automatically converts them to CRLF line endings and i have to manually open them up, convert them to unix, save em, commit them, repeat when updated.
now, if i do
git config --global core.autocrlf false
then git will stop trying to assume what i want by converting the line endings and blindly copy them, correct?
is there a way that i can push this configuration setting to all the users of my repository or does each user have to set this variable themselves
Options that are set with git-config for a single repository are saved inside .git/config, which is not pushed to other users.
But you can get the same result with gitattributes. Attributes can be set in a file named .gitattributes inside the workingtree, so it will be pushed to others. Furthermore they can be set for single files or patterns. Put
*.sh -text
in the .gitattributes file. This will stop all files ending in .sh
from being automatically converted.
Alternatively you could write
*.sh eol=lf
to force conversion to unix format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With