Repo specific ignore files in git
Is it possible to have repo specific .gitignore files? Eg:
- Git ignore - Application logs
- Keep part of .gitignore under version control but another part out
- How can I git pull ignored files?
- Apply gitignore on an existing repository already tracking large number of files
- What to gitignore from the .idea folder?
- .gitignore files added inside Git submodules
The purpose behind this is that we deploy using git on to a managed cloud service and we’d like to keep dev files in version control but not push them to a repo.
3 Solutions collect form web for “Repo specific ignore files in git”
Yes, you can put per repository ignore patterns in
.git/info/exclude in each repository.
(Note, this only affects what is ignored in each repository, it won’t affect files that you actively place under source control and the push. I’m not completely clear on your desired use case.)
Yes you can, just can’t have them in the same folder. If you create a new folder, day “deploy” and publish your deploy data there, it will use the .gitignore in that folder (not the root one).
You could probably do this using git hooks (the scripts in .git). post-checkout sounds good.