I recently upgraded my Nx monorepo workspace from v13 to v16 using the nx migrate command and did the required modifications manually. The command added an .nx folder with a cache subfolder:
The nx migrate command didn't add the cache folder to .gitignore. While I don't think local caches should be version controlled and committed to git, the folder contains other files with meaningful names (nxdeps.json, file-map.json, etc.) that I'm not sure if they are mandatory for the upgraded nx version.
Should I add .nx/cache to my .gitignore?

Yes, after continuing the upgrade from Nx v16 to v17, the migration tool automatically added
.nx/cacheto.gitignoreHowever, if you've already committed file(s) from
.nx/cache, remember to remove it from Git's tracking system by running:otherwise just adding the folder to .gitignore won't do the work.