Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
docs:git:backing_up_repository [2010/04/29 13:42] – billh | docs:git:backing_up_repository [2010/05/28 11:28] (current) – billh | ||
---|---|---|---|
Line 34: | Line 34: | ||
git fetch | git fetch | ||
</ | </ | ||
+ | |||
+ | ===== automating backup of many repos ===== | ||
+ | * you have many projects that you want to backup, like to a usb drive | ||
+ | * clone each project< | ||
+ | cd / | ||
+ | git clone --mirror / | ||
+ | </ | ||
+ | * create a shell script (i.e. **pullall.sh**) to loop through each project and fetch< | ||
+ | #!/bin/sh | ||
+ | |||
+ | `which ls` -1d *.git | while read item;do | ||
+ | echo -e " | ||
+ | cd " | ||
+ | git fetch --all --force | ||
+ | cd .. | ||
+ | done | ||
+ | </ | ||
+ | * run the script with ./ | ||