Skip to content

Git Move failure when using wildcards #1443

@agirault

Description

@agirault

Hoping to move all files from the foo folder to the current folder (.)

The raw git command looks like this: git mv foo/* .

Using GitPython, those are the two alternatives I could attempt:

repo.index.move(['foo/*', '.']) # -> cmdline: git mv --dry-run foo/* .
repo.git.mv('foo/*', '.') # -> cmdline: git mv foo/* .

They both return the same error:

git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  stderr: 'fatal: bad source, source=foo/*, destination=*'

What is surprising to me is:

  • error says "bad source" but the generated cmdline looks good and actually works when running them in the terminal
  • destination input is . but stderr shows *

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions