11

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?

pydanny
  • 7,954
  • 6
  • 34
  • 42
jgomo3
  • 1,153
  • 1
  • 13
  • 26

1 Answers1

16

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
v1k45
  • 8,070
  • 2
  • 30
  • 38
  • 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). – jgomo3 Mar 24 '16 at 19:41
  • Say 'yes' to delete and reclone. Then in the future if you want to use the latest cookiecutter-django, do the same. – coffee-grinder Apr 16 '16 at 20:51