Ritvik Bhomia
Ritvik Bhomia

Reputation: 11

Warning: LF will be replaced by CRLF

We fetch the discrepencies of our salesforce org and our bitbucket repository and add commits with differences for each component type: Steps for automated script:

  1. Create a new branch and checkout to that branch.
  2. Fetch salesforce components (by type) for ex: retrieve all the apex classes using ant that are in repo and created a commit with differences.

But all the commits show a warning for many files: LF will be replaced by CRLF in src/classes/class_name.cls

Hence, unmodified or unchanged files are also added in the commits due to mismatch in line endings i.e. CRLF & LF or \r\n and \n.

I tried repeating this process using all the configurations and combinations:

# First try
git config core.autocrlf true

# Second try
git config core.autocrlf false

# Third try
git config core.autocrlf input

Also Tried

## .gitattributes
eol=lf 
text=auto

But results are the same, PS: I am using a windows machine.

How to remove these unmodified files?

I dont want to use --ignore-whitespaces as it will also exclude space differences elsewhere in the file not just eol.

Upvotes: 0

Views: 52

Answers (0)

Related Questions