TheLettuceMaster
TheLettuceMaster

Reputation: 15734

Github showing entire file on Single Line

After committing in git bash, I went to verify the code on GitHub and noticed the file that changed looked like this:

<?php^M^Mrequire_once GLOBAL_INCLUDES . DS . "api.php";^M^Mclass MyAPI extends API {^M^Mprotected $User;   // continues for a long time on this line, a 1000 line file all to the right of this --->

Obviously this is a line ending issue with the ^M^M (or at least I think this is obvious?)

I have since tried to normalize all of my lines in my entire project using github's instructions. I did git config --global core.autocrlf true to no avail.

How can I resubmit the file (actually multiple files) to git/GitHub short of wiping my project and making a new repository?

Upvotes: 2

Views: 1251

Answers (1)

TheLettuceMaster
TheLettuceMaster

Reputation: 15734

In my Netbeans IDE environment, I found a plug in that fixed this:

All of the problem files were "Mac OS 9 (CR)"

Changing them either to Unix (LF) or Windows (CRLF) -- then committing and pushing to GitHub fixed the issue.

Upvotes: 1

Related Questions