Intro

Reference

Configure user

Check your current user config:

git config --list

Update your user config:

git config --global user.name "Thomas A. Anderson"
git config --global user.email "thomas.anderson@metacortex.com"

Create .gitignore

Add .gitignore file to the repository’s root.

# -----------------------------------------------
# OS generated files

.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# -----------------------------------------------
# Node

node_modules

Create .gitattributes

Add .gitattributes file to the repository’s root.

This will force future commits to use LF endings:

# Force text files to have "LF" endings (not "CRLF").
# See: https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/
* text=auto

Cleanup files committed with CRLF endings

Run this in terminal to cleanup files already added with CRLF endings:

git add --renormalize .

Reference