Based on this answer, you can do something like follow assuming your can use bash command (I guess you can do this in git prompt).
cd $Git_Repo
for file in $(git ls-files --others --exclude-standard); do mkdir -p ../backup/$(dirname $file) ; mv $file ../backup/$file ; done
The last command loops on all untracked files, creates structure (dirname
) in backup destination folder file. It moves file where it needs.
NOTE:
If you have filenames with spaces, you have to specify the delimiter IFS for bash during your command (source). Do not forget to unset this after.
The command becomes
cd $Git_Repo
IFS=$'\n'
for file in $(git ls-files --others --exclude-standard); do mkdir -p ../backup/$(dirname $file) ; mv $file ../backup/$file ; done
unset IFS