On Windows you can use:
FOR %F IN (*) DO IF NOT %F == old_app git mv %F old_app
FOR /D %D IN (*) DO IF NOT %D == old_app git mv %D old_app
If you're doing this in a batch file, you'll need to use %%F
and %%D
instead of %F
and %D
, respectively.
Answer inspired by https://superuser.com/a/112141 .