Inconsistent end line type SVN error FIX Ubuntu and Windows, Linux, OSx, Mac

Argggg! Again you are on a Deadline, trying to do you job, and you have to work with someone that uses a Windows machine.

You set up UTF-8 encoding because you know that little devil has native ISO-8859-1 encoding, you check the files, you do everything you need to to. You are about to commit all that work so everyone can share and… Guess what? You can’t! Notepad++ might fix this issue, but most editors in Windows have strange behaviours regarding to EOL styles (End Of Line), and the difference between Linux and Windows are greater than you think.

Why?

Unix and Windows have different EOL styles (yes, not even with something as simple as this they work the same way)

MSDOS EOL: “\r\n” (CR+LF)

UNIX EOL: “\n” (LF)

How to fix it?

1) Well, the problem actually is precisely that: EOL style. So you have to fix that, nothing more. How? Well, that depends on your enviroment.

First possible solution

Transmitting file data .svn: Commit failed (details follow):

svn: File ‘/whatever/whatever/whatever/whatever.ext’ has inconsistent newlines
svn: Inconsistent line ending style

Solution

Type the following in respective directory file and filename

svn propdel svn:eol-style yourfile.ext

Not working?

Try installing subversion with “apt-get install subversion”

Second possible solution

So you tried the first solution, and maybe because of the version of SVN that you are using, or may be the changes your SVN clients does to the .svn directories is not working either.

How to solve?

Check for EOL properties withing your client. Generally in Properties-> EOL style is the answer.

You must choose Unix (LF) because the thing that is breaking your code is that the EOL type has changed to “Windows (CR+LF)”.

That’s why.

And don’t forget to do it forced. Nothing bad will happen (get a backup anyways), but many times without forcing it, it won’t simply work.

Third possible solution

Install dos2unix

apt-get install dos2unix or for OSx: sudo port dos2unix

find . -name \*.file | xargs dos2unix

What if I have Notepad++ and I’m using Windows?

Well, get a Linux box first. If you can’t, open the file with Notepad++ and go to:

Edit –> EOL converstion–> UNIX FORMAT (or Mac FORMAt)

Save, and you are done.

Hope I saved a few minutes of your time! If so, please, comment!

Thanks!

Share

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment