纱线 v2 gitignore [英] Yarn v2 gitignore
问题描述
我将 yarn 从 v1.22.0 升级到 v2.0.0-rc.29.它生成了 .yarn 文件夹:
I upgraded yarn from v1.22.0 to v2.0.0-rc.29. It generated .yarn folder with:
- 文件夹:cache、releases、unplugged
- 文件:build-state.yml
我应该将整个 .yarn 文件夹添加到 .gitignore 吗?或者可能是其中的一些嵌套文件夹,例如 .yarn/cache?
Should I add whole .yarn folder to .gitignore? Or maybe some nested folders in there like .yarn/cache?
UPD:另外,如何处理 .pnp.js.我是提交它,还是添加到 .gitignore
UPD: Also, what to do with .pnp.js. Do I commit it, or add to .gitignore
推荐答案
参见 问题&文档的回答部分.它已经更改了好几次,因此只需点击该链接即可获得最新答案!
但本着 StackOverflow 的无链接答案"的精神;这是快照:
But in the StackOverflow spirit of "no link-only answers" here's a snapshot:
如果您使用的是零安装:
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
如果您不使用零安装:
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
请注意,在您提到的路径中,只有 .yarn/releases
不应在 .gitignore
中.
Note that, of the paths you mention, only .yarn/releases
should not be in .gitignore
.
这篇关于纱线 v2 gitignore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!