How can I create a .gitignore file and add:
/node_modules
.DS_Store
.env
all in one command line?
I know I can do this: echo ".DS_Store" >> .gitignore
The classic way to do this is using a HEREDOC (see man bash
)
cat - <<EOF >> .gitignore
/nodemodules
.DS_Store
.env
EOF