How to tell cookiecutter to download a stable version of cookiecutter-django?
Asked Answered
E

1

12

The command:

cookiecutter https://github.com/pydanny/cookiecutter-django/

will clone the lastest version of cookiecutter-django, which is aimed for Django 1.9.

There is a Stable section in the README pointing to some tags. One of them being https://github.com/pydanny/cookiecutter-django/releases/tag/1.8.7.

But if I try:

cookiecutter https://github.com/pydanny/cookiecutter-django/releases/tag/1.8.7

I get an error:

subprocess.CalledProcessError: Command '[u'git', u'clone', u'https://github.com/pydanny/cookiecutter-django/releases/tag/1.8.7']' returned non-zero exit status 128

So, how to specify cookiecutter to use those stable released instead of the master branch?

Euripides answered 24/3, 2016 at 18:0 Comment(0)
F
18

According to cookiecutter docs, You can choose to checkout specific branch, tags and commit with CLI argument --checkout or -c

Something like this command should work:

$ cookiecutter https://github.com/pydanny/cookiecutter-django.git --checkout 1.8.7
Forespent answered 24/3, 2016 at 18:36 Comment(2)
This works for me. But it unveils a new problem: doing that after have used the template without the checkout option, cookiecutter warns you about I had colned cookiecutter-django.git, and propose me "to delete and re-clone it?". So, it seems that I can't have both versiones of the same template (i.e cookiecutter-django).Euripides
Say 'yes' to delete and reclone. Then in the future if you want to use the latest cookiecutter-django, do the same.Ignatzia

© 2022 - 2024 — McMap. All rights reserved.