'GIT .env on local vs remote

During development of product I need to keep some configuration file in my repository on local machine. How can I keep pushing everything to the remote repo and keep the configuration file only on local machine?

Anytime I push to remote git delete the config file from my local repo.



Solution 1:[1]

Just add you file into the .gitignore

######################
# ENV configs
######################
.env

or custom file path:

/src/main/resources/fileName.env

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1