Skip to content

Commit c7476b0

Browse files
author
nickpape-msft
authored
Merge pull request microsoft#41 from Microsoft/nickpape/gitattributes
Add a gitattribute file to normalize newlines
2 parents b0cce18 + 6bc4dd6 commit c7476b0

1 file changed

Lines changed: 68 additions & 0 deletions

File tree

.gitattributes

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Prevent Git to auto detect text files and perform LF normalization.
2+
* -text
3+
4+
# The item with `binary` is treated as binary file.
5+
# The item with `eol=lf` is converted to LF on checkin, back to LF on checkout.
6+
# The item with `eol=crlf` is converted to LF on checkin, back to CRLF on checkout.
7+
8+
# To get full extension list in the repo, remove the node_modules folder and run the following PowerShell cmdlet.
9+
# PS> Get-ChildItem . -Recurse | Where-Object { -not $_.PSIsContainer } | ForEach-Object { $_.Extension.ToLower() } | Sort-Object | Get-Unique
10+
11+
# If new extensions are added, please refresh the repo with the following commands.
12+
# Reference: https://git-scm.com/docs/gitattributes
13+
# > rm .git/index # Remove the index to force Git to
14+
# > git reset # re-scan the working directory
15+
# > git status # Show files that will be normalized
16+
# > git add -u
17+
# > git add .gitattributes
18+
# > git commit -m "Apply end-of-line normalization based on updated .gitattributes file"
19+
20+
*.aspx text eol=crlf
21+
*.bowerrc text eol=lf
22+
*.cmd text eol=crlf
23+
*.command text eol=lf
24+
*.config text eol=crlf
25+
*.cs text eol=crlf
26+
*.csproj text eol=crlf
27+
*.css text eol=crlf
28+
*.dll binary
29+
*.editorconfig text eol=lf
30+
*.eot binary
31+
*.example text eol=crlf
32+
*.exe binary
33+
*.gif binary
34+
*.gitattributes text eol=lf
35+
*.gitignore text eol=lf
36+
*.gitmodules text eol=lf
37+
*.html text eol=crlf
38+
*.ico binary
39+
*.jpg binary
40+
*.js text eol=crlf
41+
*.json text eol=crlf
42+
*.less text eol=crlf
43+
*.map text eol=lf
44+
*.md text eol=crlf
45+
*.npmignore text eol=lf
46+
*.png binary
47+
*.ps1 text eol=crlf
48+
*.rels text eol=crlf
49+
*.resx text eol=crlf
50+
*.scss text eol=crlf
51+
*.sln text eol=crlf
52+
*.svg text elf=lf
53+
*.ts text eol=crlf
54+
*.tsx text eol=crlf
55+
*.ttf binary
56+
*.woff binary
57+
*.wsp binary
58+
*.xml text eol=crlf
59+
60+
# NPM "bin" scripts MUST have LF, or else the executable fails to run on Mac.
61+
# This fnmatch expression only matches files in a "bin" folder and without
62+
# a period in the filename.
63+
/*/*/bin/+([!.]) -text
64+
65+
# Don't allow people to merge changes to these generated files, because the result
66+
# may be invalid. You need to run "rush generate" again.
67+
/common/npm-shrinkwrap.json merge=binary
68+
/common/temp_modules/** merge=binary

0 commit comments

Comments
 (0)