Skip to content

copier copy didn't copy my uncommit file even though I added -r HEAD option #1887

Open
@kamontat

Description

@kamontat

Describe the problem

copy on repository contains uncommit files doesn't works even when added -r HEAD option.

Template

hello {{name}}

To Reproduce

  1. Create empty directory
  2. Create copier.yaml contains content below
_min_copier_version: 9.4.1
_subdirectory: templates
name:
  type: str
  help: What is your name?
  1. Create templates directory and file named message.txt
  2. The file should contains hello {{name}}
$PWD/example:
  copier.yaml: |
    _min_copier_version: 9.4.1
    _subdirectory: templates
    name:
      type: str
      help: What is your name?
  templates/message.txt: |
    hello {{name}}
  1. Run copier copy . .temp and it should works normally
  2. Run git init
  3. Rerun copier copy . .temp again and it doesn't works anymore
  4. Even with copier copy -r HEAD . .temp, it doesn't works as well

CleanShot 2024-12-12 at 17 50 31@2x

Logs

.../copier/9.4.1/venv/lib/python3.12/site-packages/copier/vcs.py:209: DirtyLocalWarning: Dirty template changes included automatically.
  warn(

Copying from template version 0.0.0.post1.dev0+9e08b53

Expected behavior

it copy templates to target directory.

Screenshots/screencasts/logs

No response

Operating system

macOS

Operating system distribution and version

MacOS 15.1.1

Copier version

copier 9.4.1

Python version

Python 3.12.2

Installation method

pip+pypi

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageTrying to make sure if this is valid or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions