Wednesday, January 29, 2014

How to solve LF would be replaced by CRLF git

It's nearly to seven in the morning (new english expressions) and before going to bed, I would like to share this experience, as the most stuff that I found over the net wasn't very impressive to my tired eyes.

I today started dealing with github and git, although there have been months since I first created an account. 
So, sometime, while trying to upload some files to a public repository of mine, I got the quoted message, displayed in the title.

I tried to find a quick solution to stackoverflow, refering to the first hits of google, here and here, but while being in a rush, my eyes caught words like unix, etc., so I tried to found out by myself what was going on, because the exact error message, did also included the filename that was causing the error.

EDIT: Before continuing reading this, be sure that you tried the following command in the git shell:

git config core.autocrlf false

Opening the file was like a dream:

  1. What I quickly understood in the fore-mentioned links, was what I exactly seeing in my file.
  2. The little knowledge that I accomplished to acquire through this quick reading, made a light flash in my mind.
The exact image was sth like this : 
So, I just had to hit my Backspace button
and everything got as default; successful push
to github accomplished!
If the above wasn't enough and you countinue getting errors, try to open the specified file with Notepad++, go to Edit => EOL Converion => Windows Format.

Dunno if this really helped you or it made your situation more difficult, but I thought about sharing it, 'cause newbies like me in github may find it useful.

No comments:

Post a Comment