Open
Description
Describe the problem
When building a project from a template, files that are included in the template that are ignore by a user's global gitignore file (as configured by git's core.excludesFile
) will be excluded from the template.
I would expect that files included in the template should be included in the project, regardless of a user's git configuration in their local environment.
One approach to handle this (on git 2.3.1+) could be to override this configuration when running git by using the below environment variables:
GIT_CONFIG_COUNT=1
GIT_CONFIG_KEY=core.excludesFile
GIT_CONFIG_VALUE=""
Template
None
To Reproduce
- Create a global gitignore file:
echo ".envrc" > ~/.gitignore
- Configure git to use said file:
git config --global core.excludesFile '~/.gitignore'
- Create a template with that file in it:
touch .envrc
- Run
copier copy
on that template - The
.envrc
file will not be in the new project
Logs
Expected behavior
Any file that is in the template will be included in the created project, even if it would be excluded by the global gitignore file.
Screenshots/screencasts/logs
No response
Operating system
Linux
Operating system distribution and version
Ubuntu 22.04
Copier version
9.7.1
Python version
3.13
Installation method
uvx+pypi
Additional context
No response