# convert crlf to eol on vendor branch overlay

3 messages from 2011-04-08 to 2011-04-08. Participants: Neal Kreitzinger, Junio C Hamano.
Thread: https://gitlist.dev/t/27031

## Neal Kreitzinger, 2011-04-08 02:40

Subject: convert crlf to eol on vendor branch overlay
Message-ID: <inlsit$scv$1@dough.gmane.org>
URL: https://gitlist.dev/e/inlsit%24scv%241%40dough.gmane.org

```
My vendor gave me a tarball with all CRLF eol's.  I'm using the 
vendor-branch overlay method (git ls-files -z | xargs -0 rm -f && tar -xvzf 
tarfile.tar.gz).  How do I convert the eol's to LF?

I tried this:

vi .git/attributes
SRC/*/* text  (convert these to LF eol on commit)

$ git config core.eol lf (convert "text" attr files to LF eol on checkout)

$ git add . -A
$ git commit -m'convert eol'  (should convert CRLF to LF)
$ git checkout otherbranch  (change worktree)
$ git checkout vendorbranch (checkout worktree from commit to get LF 
version)
$ git reset HEAD^  (remove commit but keep worktree LF version)
$ git diff (still CRLF)
$ git status (still show everything as modified due to CRLF)

v/r,
neal 

```

## Junio C Hamano, 2011-04-08 04:43

Subject: Re: convert crlf to eol on vendor branch overlay
Message-ID: <7vy63l4ak6.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy63l4ak6.fsf%40alter.siamese.dyndns.org
In-Reply-To: <inlsit$scv$1@dough.gmane.org>

```
"Neal Kreitzinger" <neal@rsss.com> writes:

> How do I convert the eol's to LF?
>
> I tried this:
>
> vi .git/attributes
> SRC/*/* text  (convert these to LF eol on commit)
>
> $ git config core.eol lf (convert "text" attr files to LF eol on checkout)

Instead, how about something like:

  $ git ls-files -z | xargs -0 perl -p -i -e 's/\r$//'

and then:

> $ git add . -A
> $ git commit -m'convert eol'  (should convert CRLF to LF)

?

```

## Neal Kreitzinger, 2011-04-08 18:18

Subject: Re: convert crlf to eol on vendor branch overlay
Message-ID: <4D9F5181.7050806@gmail.com>
URL: https://gitlist.dev/e/4D9F5181.7050806%40gmail.com
In-Reply-To: <7vy63l4ak6.fsf@alter.siamese.dyndns.org>

```
On 4/7/2011 11:43 PM, Junio C Hamano wrote:
> "Neal Kreitzinger"<neal@rsss.com>  writes:
>
>> How do I convert the eol's to LF?
>>
>> I tried this:
>>
>> vi .git/attributes
>> SRC/*/* text  (convert these to LF eol on commit)
>>
>> $ git config core.eol lf (convert "text" attr files to LF eol on checkout)
>
> Instead, how about something like:
>
>    $ git ls-files -z | xargs -0 perl -p -i -e 's/\r$//'
>
> and then:
>
>> $ git add . -A
>> $ git commit -m'convert eol'  (should convert CRLF to LF)
>
> ?
That worked!  Thanks!

```
