cco*_*ker 7 git github angular-cli angular
如何从Angular 4项目的github中排除环境文件。
我已经将.gitignore更新为以下内容,但是我的环境文件仍在同步到github:/ src / environments / **
# 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
/src/environments/**
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db
Run Code Online (Sandbox Code Playgroud)
Joe*_*lay 11
gitignore文件的目的是确保未被Git跟踪的某些文件保持未跟踪状态。
换句话说,gitignore不会删除存储库中已经存在的文件,只会停止首先添加它们。因此,如果您已经不小心提交了环境文件,将它们添加到gitignore是不够的。您还需要取消跟踪文件。
该文档接着说了如何解决它:
要停止跟踪当前跟踪的文件,请使用git rm --cached。
请注意,这不会从提交历史记录中删除该文件,但是-如果您不小心泄露了任何敏感信息,请参阅GitHub文档以获取有关操作的信息。
归档时间: |
|
查看次数: |
3253 次 |
最近记录: |