Optionally copy a template without updating all git submodules
See original GitHub issueWhen a user has a template with a large number of git submodules, they may not want to immediately init all of them.
A potential use case (true in my case) is that there are submodules that are made only in certain cases. The submodule contains a large number of other submodules only some of which are needed in particular cases. Checking all of them out when copying takes a large amount of time and is not necessary.
As a user I would like to be able to copy a template without recursively initializing them all, as this takes a large amount of time, I would prefer to be able to set copier to be able to copy without init and then initialize my submodules later.
Without this capability in some form or another it becomes relatively impossible to develop templates for projects with large amounts of submodules
Suggestion
copier -m <url> <path>
copier --no-submodule <url> <path>
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
About caching, there’s nothing you can do ATM. I was just talking about an hypothetical new feature for copier. Right now it’s not supported.
About the issue you’re talking about, I also think you must be using Copier wrong somehow. The purpose of including sumamodules in a template is to be able to share code between templates. If what you want is to include some submodule in your repo, it’s better if you generate the
.gitmodules
file with Copier and, then, after generating, you manually call your git commands at will. Or you usetasks
to automate it.I hope it helps. I’ll close this now assuming there’s something wrong in the way you’re using Copier. If you still need more help, please provide specific steps to reproduce and reopen.
After playing with it more, I’m noticing that copier seems to be adding all the files in the submodules as new files - do I need to do some configuration or something to get these to be treated as submodules. I need to be able to commit my project and I cannot commit every file in the submodule as they are enormous, I’m getting the feeling that I’m not using this correctly.