mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Adds .gitattributes to force Go files to LF
Even on Windows machines, we want *.go files to have LF line endings (go fmt insists). This leaves other files as auto, but makes *.go files always be LF on Windows machines. With this change, running go fmt will be a pleasant operation, not a painful one. Note that changing .gitattributes only affects files at initial checkout. To update an entire working directory after making a change like this, do this (but only after committing all work in progress, this will destroy uncommitted changes): $ git rm --cached -r . $ git reset --hard Again - do not do this to a working directory with uncommitted work in it.
This commit is contained in:
parent
23d5fc82ee
commit
6a2968fd5c
1 changed files with 5 additions and 0 deletions
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Text files have auto line endings
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Go source files always have LF line endings
|
||||||
|
*.go text eol=lf
|
Loading…
Reference in a new issue