Move or rename a file, a dirctory or a symlink.
fatal: bad source, source=path/to/*.…, destination=another/path/
When trying to use a
wildcard in
PowerShell to rename a set of files,
git mv
might throw a
fatal: bad source, source=path/to/.…, destination=another/path/* error.
The following command is supposed to move all SQL files to a sub directory named db-objects
:
PS> git mv *.sql db-objects
fatal: bad source, source=errors/*.sql, destination=db-objects/*.sql
The wildcard needs to be expanded explicitly:
Ps> git mv (get-childItem *.sql) db-objects
get-childItem
can be abbreviated with its alias gci
:
Ps> git mv (gci *.sql) db-objects