git - yarn v2 gitignore

标签 git gitignore yarnpkg yarn-v2

我将 yarn 从 v1.22.0 升级到 v2.0.0-rc.29。它生成了 .yarn 文件夹:

  • 文件夹:缓存、释放、拔出
  • 文件:build-state.yml

  • 我应该将整个 .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/

    相关文章:

    node.js - 在 travis ci 上构建 webpack

    git - git 提交消息的 vim 语法突出显示 - 自定义 commentchar

    Git:在一个命令中将一系列提交复制到其他提交,不涉及分支

    codeblocks - 如何在 gitignore 中添加可执行代码块?

    git - *~ 在 .gitignore 文件中做什么?

    git - 为什么 visual studio 在我的 .gitignore 文件中提交文件?

    node.js - Ember.js 2.7 不使用 yarn 构建 - 使用 npm 构建

    css - rails : Precompiled assets missing node modules

    git - 在 Git 中,我如何确定我当前的版本是什么?

    git - 哪个版本控制允许文件级别的访问权限?