move all files of current directory into subdirectory and maintain history

前端 未结 7 1082
不知归路
不知归路 2021-02-05 03:00

How can I move all the files of my current directory into a new directory and retain the history.

I have tried:

git mv . old_app

But I

7条回答
  •  醉梦人生
    2021-02-05 03:53

    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 .

提交回复
热议问题