Information Technology Reference
In-Depth Information
When you finish Recipe 13-3 the repository would contain the line endings presen-
ted in Table 13-2 .
13-4. Converting line endings to CRLF
in the working directory during checkout
and committing the change
Problem
You work in a repository that contains text files using different line endings. You want
to:
• Convert all the files in the working directory to use CRLF line endings
• Commit the files with CRLF line endings into the repository
This revision should internally (i.e., in the git database) use CRLF encodings. If
someone clones this repository without any conversion of new lines (i.e., with auto-
crlf set to false ), they should get the working directory with all text files using
CRLF .
Solution
Clone the repository from Recipe 13-1:
$ cd git-recipes
$ git clone 13-02 13-04
$ cd 13-04
Now convert the line endings in the working directory to CRLF :
1. Set the core.autocrlf option to true with $ git config --
local core.autocrlf true
2. Remove all tracked files with $ git ls-files | xargs rm
Search WWH ::




Custom Search