Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
I'm a full stack web developer who has been freelancing for the last 20 years. I write about everything from development to production and also have video courses on my site!
That's pretty dangerous advice because it depends on how you configure your application.
I personally commit .env files because they don't contain sensitive information and typically having settings important to being able to start up my app in development. I have a feeling just about anyone using Docker Compose would also commit .env files too since it's used for setting your project name.
I reserve .env.prod or other environment specific files for sensitive API keys and other things I wouldn't want to commit.
Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
I'm a full stack web developer who has been freelancing for the last 20 years. I write about everything from development to production and also have video courses on my site!
I just mean putting it into your main .gitignore file is dangerous because you run the risk of not committing essential settings to make your project work if it depends on .env being around.
Using --force every time they want to add a file isn't a viable solution IMO. That's a command you might run 50 times a day.
In other words, you should add .env on a per project basis when your project may have .env files that contain sensitive info, just like you would want to ignore any other files that have sensitive data.
Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
Nope, thats what they say but is it a bad practice.
Each env had its own tweaks and sometimes diffenrent platforms, tasks, settings and folders. Each dev should have the liberty of using its own IDE in their own productive way.
Ah yes, let's not use the tool as instructed. That will go great.
Each env had its own tweaks and sometimes diffenrent platforms, tasks, settings and folders. Each dev should have the liberty of using its own IDE in their own productive way.
Yeah, and they tell you exactly which things to exclude in order to get that.
Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
Do some research on the topic you will see that many other developers share my opinion. Do not blindly trust the IDE creators, for them is a business, for you is just a tool.
IDE's are local tools, they are not related to the project. A big project then will have
.vim
.idea
.eclipse
.atom
.vscode
folders. Where did you saw that?
You can also browse popular open source projects source code and see that most of them do not have IDE config files.
That's because devs want "clean" repos, but there is a JetBrains template, which will ignore USER settings, but you should still commit PROJECT setttings, as not all settings can be read from .editorconfig or linting etc.... This will help other devs that uses that IDE to not waste time on configuring the IDE to get auto-format correct etc... Also VSCode has files that should be committed.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
vim ~/.gitignore
Do not think you will not make a mistake, be proactive and presume you will, we are only humans.
Edit: this will prevent adding to your project your IDE config files, environment and private keys
Best and most useful solution. prevention before cure.
Awesome, just did this in all my repos.
We're glad to hear that!
Cheers! ๐ฅ *clink*
That's pretty dangerous advice because it depends on how you configure your application.
I personally commit
.env
files because they don't contain sensitive information and typically having settings important to being able to start up my app in development. I have a feeling just about anyone using Docker Compose would also commit.env
files too since it's used for setting your project name.I reserve
.env.prod
or other environment specific files for sensitive API keys and other things I wouldn't want to commit.It is not dangerous and also .env.prod is very specific.
You can always commit the files from gitignore, but you have to do it explicitly, so you avoid mistakes
--force
.I just mean putting it into your main
.gitignore
file is dangerous because you run the risk of not committing essential settings to make your project work if it depends on.env
being around.Using
--force
every time they want to add a file isn't a viable solution IMO. That's a command you might run 50 times a day.In other words, you should add
.env
on a per project basis when your project may have.env
files that contain sensitive info, just like you would want to ignore any other files that have sensitive data.You shouldn't ignore the idea folder. you're supposed to commit almost all of it to the repo.
intellij-support.jetbrains.com/hc/...
rider-support.jetbrains.com/hc/en-...
Nope, thats what they say but is it a bad practice.
Each env had its own tweaks and sometimes diffenrent platforms, tasks, settings and folders. Each dev should have the liberty of using its own IDE in their own productive way.
Ah yes, let's not use the tool as instructed. That will go great.
Yeah, and they tell you exactly which things to exclude in order to get that.
You should include the idea folder. End of story.
No, sorry.
Do some research on the topic you will see that many other developers share my opinion. Do not blindly trust the IDE creators, for them is a business, for you is just a tool.
IDE's are local tools, they are not related to the project. A big project then will have
.vim
.idea
.eclipse
.atom
.vscode
folders. Where did you saw that?
You can also browse popular open source projects source code and see that most of them do not have IDE config files.
That's because devs want "clean" repos, but there is a JetBrains template, which will ignore USER settings, but you should still commit PROJECT setttings, as not all settings can be read from
.editorconfig
or linting etc.... This will help other devs that uses that IDE to not waste time on configuring the IDE to get auto-format correct etc... Also VSCode has files that should be committed.