0

When I change anything in my project and save it, it always shows some changes in .next folder. I know this is something issue in .gitignore, but how can i fix it?

enter image description here

LeGEC
  • 46,477
  • 5
  • 57
  • 104
SAMEER
  • 61
  • 6
  • [The same way](https://git-scm.com/docs/gitignore) you ignore any other file or directory. – Thomas Aug 04 '22 at 07:06
  • I already add ./next in .gitignore file, but still same issue. – SAMEER Aug 04 '22 at 07:08
  • .next folder is used o be created while you build or run your project – illia chill Aug 04 '22 at 07:14
  • 1
    See question linked as duplicate : run `git rm -r --cached .next/` followed by `git commit`. If you additionally want to remove this directory from all past commits, see [this answer](https://stackoverflow.com/a/64563565/86072) – LeGEC Aug 04 '22 at 07:17
  • can you please share your gitignore? – Talha Fayyaz Aug 04 '22 at 07:17
  • hi @TalhaFayyaz, this my git ignore file. # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies /node_modules /.pnp .pnp.js # 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 – SAMEER Aug 04 '22 at 07:19
  • i think simply doing .next would be enough no need to put / in front of it. – Talha Fayyaz Aug 04 '22 at 07:22
  • no @TalhaFayyaz, I tried but not worked – SAMEER Aug 04 '22 at 07:45
  • you have to also remove it from your git remote if it is already commited. – Talha Fayyaz Aug 04 '22 at 07:54

0 Answers0