【问题标题】:Angular2 .gitignoreAngular2 .gitignore
【发布时间】:2020-01-14 16:19:45
【问题描述】:

我正在设置一个 Angular 2 示例项目。我的.gitignore 已经够了吗?还是我错过了什么?

node_modules
typings
jspm_packages
bower_components
app/**/*.js
app/**/*.map

【问题讨论】:

    标签: javascript git angular gitignore


    【解决方案1】:

    angular-cli 生成

    # See http://help.github.com/ignore-files/ for more about ignoring files.
    
    # compiled output
    /dist
    /tmp
    /out-tsc
    
    # dependencies
    /node_modules
    
    # IDEs and editors
    /.idea
    .project
    .classpath
    .c9/
    *.launch
    .settings/
    *.sublime-workspace
    
    # IDE - VSCode
    .vscode/*
    !.vscode/settings.json
    !.vscode/tasks.json
    !.vscode/launch.json
    !.vscode/extensions.json
    
    # misc
    /.sass-cache
    /connect.lock
    /coverage
    /libpeerconnection.log
    npm-debug.log
    testem.log
    /typings
    
    # e2e
    /e2e/*.js
    /e2e/*.map
    
    # System Files
    .DS_Store
    Thumbs.db
    

    【讨论】:

    • ng new MyProject 不包含任何.gitignore 文件...?
    • 我不知道为什么。我敢肯定它应该。这是它应该生成的文件github.com/angular/angular-cli/blob/…
    • 谢谢!发现了问题。由于stackoverflow.com/a/43525586/3779853,ng cli 没有正确更新。
    • /e2e/*.ts 怎么样?
    • 2021 年 - 创建应用时自动生成此文件 - ng 版本 11 - npm 版本 12 - @phil294
    猜你喜欢
    • 1970-01-01
    • 2013-06-08
    • 2016-07-19
    • 1970-01-01
    • 2017-11-13
    • 2017-12-05
    • 1970-01-01
    • 1970-01-01
    • 2011-03-20
    相关资源
    最近更新 更多