Is the file src\environments\environment.ts
typically committed, or added to the .gitignore
file?
In a new Angular project (8.x) I see that this file is not added to the .gitignore
file, and I assume that it's like this because the project imports this file (or a replaced version of it, depending on the specified configuration).
The real question is this: If a developer wishes to make local, developer-specific changes to this file (f.e. a different apiUrl
setting), should they:
- Keep this file committed with shared defaults, ignore the file locally only when needed (not affecting other developers), and then make local changes.
- Initially commit this file with shared defaults, add it to
.gitignore
for all users, and then make local changes. - Never commit the file (developers would have to create the file when first checking out the code).