1

On a unix machine you can run:

cp $(git ls-files --modified) ../modified-files

To copy the modified files to another directory. I'd like to do this on the Windows command line. (This command doesn't work).

My question is: What is the Windows command for using git ls-files to copy modified files?


EDIT:

git version is: git version 1.9.5.msysgit.0

Clarification: The issue isn't whether the git ls-files command works or not - the question is how to pass this list of files into the copy command.

hawkeye
  • 34,745
  • 30
  • 150
  • 304

1 Answers1

1

This is what I worked out:

for /F %I in ('git ls-files --modified') do set a=%I |  copy  %a:/=\% c:\temp
hawkeye
  • 34,745
  • 30
  • 150
  • 304