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
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
Post a Comment