Selective git ignore remote?

Let's say I have a project that is located both on a public open source repository and on a private development repository. Some files in the development repository include things like database passwords, and things that I don't want publicly. What would be the best way to share secure files between two remote devices? I think some kind of .gitignore file that only applies to public repo is possible? If not, any other suggestions?

+5
source share
3 answers

Maybe put more sensitive files in another repo, modulate it in the original repo and provide only your private developers access to the private repo.

+3
source

If there really are files that should not be publicly run for the sake of securities, do not put them in the repository or encrypt the files with a password!

Best of all, when you put unshared files in a separate repository, which can live in a private version of development:

BASE_DIR/.git
BASE_DIR/private/.git

Here BASE_DIR contains all publicly available files. BASE_DIR / private contains private files.

When you just publish data, not a repository (with all its history), you can simply

git --work-tree=PATH_TO_THE_PUBLIC checkout HEAD -- .

when the new version appears.

0
source

, . .gitignore ; .

( , .)

-1
source

All Articles