Skip to content

.gitconfig and core.autocrlf

A few notes on the git things I dealt with today:

I updated my .gitconfig file to exclude everything in my wordpress directory from source control except plugins and themes. Since these were already in my repository, I need to remove them-git rm -rf –cached $files will do the trick. Note that if you leave off the –cached parameter, the files will be removed from the filesystem in addition to the repository. Care is required.

I had an upgrade to the headspace2 plugin on my wordpress installation today. When I tried to commit these changes to the repository, I got the following error:

“fatal: LF would be replaced by CRLF in blog/wp-content/plugins/headspace2/2.3/jquery.js”

I changed my core.autocrlf from input to false and re-added; this stopped end-of-line coercing and allowed me to get the file into version control. I’ve read that core.autocrlf should be on input for almost all use cases, so I’ve changed it back. I’m not sure what the long-term repository ramifications of this bit of hackery are; the headspace plugin will be a decent test case, and I’ll keep an eye out for problems.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*