I will figure out how to do it.
In my case, I needed to synchronize the project with heroku and github (as a public repo).
But some files with personal information were not of interest for sharing in a public repository
Usually a simple project has the following folder structure
Project folder (remote heroku) - .git - .gitignore - (folders and files)
What I did was add another level, and in it create another git repository, with gitignore, which would omit some files from my project.
Project public (remote github) - .git - .gitignore - Project folder (remote heroku) - .git - .gitignore - (folders and files)
So this is not a git repository with two remote repositories with different gitignores.
There are two different repositories.
In the innermost part, I exclude only the files generated by the IDE and some files created at runtime.
At the most external level, I exclude all files that cannot be published.
Guilherme Apr 25 '17 at 20:28 2017-04-25 20:28
source share