Quantcast
Channel: Windows 7 Miscellaneous forum
Viewing all articles
Browse latest Browse all 11372

Copy .git directories keeping the directory structure

$
0
0

I want to create a script that searches through all folders in one drive and copy all folder named.git and it's content on a backup location with the exact same folder sturcture.

For example: take this structure

root |+ Folder 1 + .git
     |          | Folder 1.1+ Folder 2
     |+ Folder 3 + Folder 3.1
     |          + Folder 3.2
     |+ Folder 4 + Folder 4.1
                |+ Folder 4.2 + .git

Should be copied (backedup) to another folder, on another drive as

backup_location |+ Folder 1 + .git
                |+ Folder 4 + Folder 4.2 + .git
Equivalent to:
backup_location\Folder 1\.git
backup_location\Folder 4\Folder 4.2\.git

Of course Folder 1 should contain only .git and Folder 4 should contain only Folder 4.2 and Folder 4.2 should only contain.git folder. All .git folders should be fully populated with all files and folder that are on original drive.

OSs for which script should be able to run are Win 7 and Win 8




Viewing all articles
Browse latest Browse all 11372

Trending Articles