question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optionally copy a template without updating all git submodules

See original GitHub issue

When 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:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yajocommented, Apr 17, 2021

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 use tasks 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.

0reactions
nmurfeycommented, Apr 16, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git-submodule Documentation - Git
This option is only valid for the update command. Initialize all submodules for which "git submodule init" has not been called so far...
Read more >
How do I "git clone" a repo, including its submodules?
git clone git://github.com/foo/bar.git cd bar git submodule update --init -- ... You can use this command to clone your repo with all the...
Read more >
Configuring a template - copier - Read the Docs
When copying or updating from a Git-versioned template, indicate which template version to copy. This is stored automatically in the answers file, like...
Read more >
Ubuntu Manpage: git-submodule - Initialize, update or inspect ...
The optional argument <path> is the relative location for the cloned submodule to exist in the superproject. If <path> is not given, the...
Read more >
EGit/User Guide - Eclipsepedia
Git Repositories can be created in different ways, for example by cloning from an existing Repository, by creating one from scratch, or by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found