-1

I created a new rails app.

rails new myfirstapp

It have created files with LF only.

I tried to init git repo.

git init

and after

git add .

I got this error:

fatal: LF would be replaced by CRLF in .gitignore

My git congfig:

core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
alias.co=checkout
alias.ci=commit
alias.st=status
alias.br=branch
alias.hist=log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
alias.type=cat-file -t
alias.dump=cat-file -p
core.quotepath=off
core.ignorecase=true
core.autocrlf=true
core.safecrlf=true
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
core.hidedotfiles=dotGitOnly

I am on Windows. What do you think?

UPD: git version 1.9.4.msysgit.0

UPD:

I read all link on stackoverflow like this:

Why should I use core.autocrlf=true in Git?!

What's the best CRLF handling strategy with git?! I dont undestend why it's not working.

Community
  • 1
  • 1
kotygoroshko
  • 342
  • 1
  • 6
  • 18

2 Answers2

0

You get that message because of

core.autocrlf=true

That's why you are getting...

...LF would be replaced by CRLF
ddavison
  • 28,221
  • 15
  • 85
  • 110
0

My solution:

rails new myfirstapp
git init 

This is for saveing files as is.

git config --global core.autocrlf input 
git add .
git commit -m"Bla bla bla"

This is for normal working and converting in windows format:

git config --global core.autocrlf true

Delete all file and directories without .git

git checkout -f

This convert all files to CRLF on working tree.

kotygoroshko
  • 342
  • 1
  • 6
  • 18