Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cloning specific folder of git repository #11

Open
klouvas opened this issue Mar 16, 2020 · 1 comment
Open

Support cloning specific folder of git repository #11

klouvas opened this issue Mar 16, 2020 · 1 comment

Comments

@klouvas
Copy link

klouvas commented Mar 16, 2020

Support specific folder cloning

Support to clone specific folder of git repository using git sparse-checkout.

Use case

Case of 1 repository with multiple templates separated by folders

Examples

Example repository structure:

# templates-repository
README.md 
python/
-- cookiecutter.json
-- {{cookiecutter._project_name}}/
---- main.py
nodejs/
-- cookiecutter.json
-- {{cookiecutter._project_name}}/
---- package.json
---- src/
------ index.js

Example of fetching specific template folder:

cookiecutter https://github.com/audreyr/cookiecutter-pypackage --partial nodejs

Links

Github: https://github.community/t5/How-to-use-Git-and-GitHub/How-can-I-download-a-specific-folder-from-a-GitHub-repo/m-p/95#M23
Git: https://git-scm.com/docs/git-sparse-checkout

@klouvas klouvas changed the title Support to clone specific folder of git repository Support cloning specific folder of git repository Mar 16, 2020
@ws1088
Copy link

ws1088 commented Apr 9, 2021

cookiecutter 1.7+ support --directory option which should work?https://cookiecutter.readthedocs.io/en/1.7.2/advanced/directories.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants