I'm not so familiar with yarn. And I have a problem ignoring the package files. I'm in the middle of committing changes. I can't turn back and ignore it.
This is my .gitignore
file:
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
node_modules
.yarn/
.yarn
/.yarn
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# local env files
.env*.local
# vercel
.vercel