Conditional .gitignore based on origin

I have an application that I want to host on Heroku. He has confidential database information that I don’t want to embed in a public repo on github ... However, I cannot add it to the gitignore file, because then it will not be redirected to the hero.

Is it possible to have a conditional gitignore where I ignore this YML file by origin, but not the hero?

+4
source share
2 answers

Unfortunately not. Git does not support this feature, so you are probably out of luck. There are various ways to get files with local ignore in different repositories ( .git/info/exclude ) or on different computers (global ignore), but nothing happens based on the source code.

The simplest workaround is to have a β€œpublic” branch in which this file is deleted and commit it to ensure that the public branch never accepted the commit that added it.

No reassurances that the blob will never leak into the public copy, however.

+5
source

You might want to explore Heroku db: push

I used this to synchronize data, and you can still ignore all the db information.

0
source

Source: https://habr.com/ru/post/1392280/


All Articles