-2

I run yarn dev or npm run dev for my porject

  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },

My git will generate a lots of Uncommitted changes like .next/build-manifest.json

enter image description here

I check .gitignore file includes

# next.js
/.next/
/out/

Why I still get the issue ?

Morton
  • 5,380
  • 18
  • 63
  • 118

1 Answers1

1

I'm assuming you added /.next/ to .gitignore afterwards, so stuff that already got in GIT won't be ignored by default, only new files added to those directories.

You also need to do git rm --cached -r .next/ which will recursively remove the files in that directory from the cache. They should appear as untracked afterwards, and you must commit the changes

Raul Rene
  • 10,014
  • 9
  • 53
  • 75