Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:git:backing_up_repository [2010/04/29 13:40] billhdocs:git:backing_up_repository [2010/05/28 11:28] (current) billh
Line 1: Line 1:
 ====== backing up repository ====== ====== backing up repository ======
 +
 +===== notes =====
 +  * do **NOT** use rsync
 +    * git is smarter about what needs copied and will be faster
 +    * a commit or other action could be in progress
  
 ===== using a hook ===== ===== using a hook =====
Line 30: Line 35:
 </code> </code>
  
-===== notes ===== +===== automating backup of many repos ===== 
-  * don't use rsyncbecause commit or other action could be in progress+  * you have many projects that you want to backuplike to usb drive 
 +  * clone each project<code> 
 +cd /path/to/your/usb/drive/destfolder 
 +git clone --mirror /project.git 
 +</code> 
 +  * create a shell script (i.e. **pullall.sh**) to loop through each project and fetch<code> 
 +#!/bin/sh 
 + 
 +`which ls` -1d *.git | while read item;do 
 +echo -e "updating ${item}...\n" 
 +cd "${item}" 
 +git fetch --all --force 
 +cd .. 
 +done 
 +</code> 
 +  * run the script with ./pullall.sh (make sure it is executable: chmod 755 pullall.sh) 
  • docs/git/backing_up_repository.1272570059.txt.gz
  • Last modified: 2010/04/29 13:40
  • by billh