git - Excluding Environment Files from Github Angular 4 Project -


how exclude environment files github angular 4 project.

i have updated .gitignore following, environment files still being synchronised github: /src/environments/**

# see http://help.github.com/ignore-files/ more ignoring files.  # compiled output /dist /tmp /out-tsc  # dependencies /node_modules  # ides , 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 

to quote git website:

the purpose of gitignore files ensure files not tracked git remain untracked.

in other words, gitignore won't remove files in repository, it'll stop them being added in first place. if you've accidentally commited environment files, adding them gitignore isn't enough; you'll need untrack files.

the documentation goes on how fix it:

to stop tracking file tracked, use git rm --cached.

note won't remove file commit history, - if you've accidentally leaked sensitive info, see github documentation info on do.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -