Reference

retrocookie

retrocookie.retrocookie(instance_path, commits=(), *, path=None, branch=None, upstream=None, create_branch=None, include_variables=(), exclude_variables=())

Import commits from instance repository into template repository.

This function imports commits from an instance of the Cookiecutter template, rewriting occurrences of template variables back into the original templating tags, and prepending the template directory to filenames. Any tokens with special meaning in Jinja are escaped.

Parameters
  • instance_path (pathlib.Path) – The source repository, an instance of the Cookiecutter template with a .cookiecutter.json file.

  • commits (Iterable[str]) – The commits to be imported from the source repository.

  • path (Optional[pathlib.Path]) – The target repository, a Cookiecutter template. This defaults to the current working directory.

  • branch (Optional[str]) – The name of a branch to be imported from the source repository. This is equivalent to passing ["master..branch"] in the commits parameter.

  • upstream (Optional[str]) – The upstream for branch. This defaults to the value of the init.defaultBranch option in git. If the option is not set, master is used.

  • create_branch (Optional[str]) – The name of the branch to be created in the target repository. By default, commits are imported onto the current branch.

  • include_variables (Container[str]) – The Cookiecutter variables which should be rewritten. If this is not specified, all variables from cookiecutter.json are rewritten.

  • exclude_variables (Container[str]) – Any Cookiecutter variables which should not be rewritten.

Return type

None