我将 yarn 从 v1.22.0 升级到 v2.0.0-rc.29。它生成了 .yarn 文件夹:
我应该将整个 .yarn 文件夹添加到 .gitignore 吗?或者可能有一些嵌套的文件夹,比如 .yarn/cache?
更新:另外,如何处理 .pnp.js。我是提交还是添加到 .gitignore
最佳答案
见 Questions & Answers section of the documentation . 它已经更改了几次,因此只需单击该链接即可获得最新的答案!
但在 StackOverflow 的“没有仅链接的答案”的精神中,这里有一个快照:
Which files should be gitignored?
If you're using Zero-Installs:
.yarn/* !.yarn/cache !.yarn/patches !.yarn/plugins !.yarn/releases !.yarn/sdks !.yarn/versions
If you're not using Zero-Installs:
.yarn/* !.yarn/patches !.yarn/releases !.yarn/plugins !.yarn/sdks !.yarn/versions .pnp.*
请注意,在您提到的路径中,只有
.yarn/releases
不应该在 .gitignore
.
关于git - yarn v2 gitignore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60184159/