« Home | How to force qmake to stop generating an XCode pro... » | American Express continues to slash credit lines (... » | Is the tech recession over or over-blown? » | Travel: Water Purification for Travelers (Part 3) » | Travel: Water Treatment and Purification Options f... » | Travel: Avoiding Water Borne Illness (Part 1) » | How do I set ssh session or serial terminal to aut... » | Nokia to License Qt 4.5 Under LGPL » | My GTD Implementation with a Day Timer » | Back in the U.S. »

Git: Script to svn rebase subdirectories

I'm now using git for all my projects.  Primarily, I am now using it as a front end to various subversion repositories at home and when I'm out and about.  As a result, I now have several directories that contain a growing number of git repositories. 

As I have become more sophisticated, I started categorize them by context.  I now have subdirectories for each context I operate under -- one for each client, one for my paperless office files, one for opens source repositories pulled from the Internet, and so on. 

For example, I will have one directory named client1 with the repositories related to work at client1.  That way when I'm on a job site and plugged into a client's network I can execute the script and all of the changes from the repositories will be pulled and merged into my repository.

For convenience, I wrote the following script execute a "git svn rebase" on each of the subdirectories. 

   1: #!/bin/sh
   2: #
   3: # Rebase git repositories in current directory
   4: #
   5: # Written by Joe Turner <joe@agavemountain.com>
   6:  
   7: for REPOSITORY in `ls -1`
   8: do
   9: echo 'Performing git rebase in : ' $REPOSITORY
  10: cd $REPOSITORY
  11: git svn rebase
  12: cd ..
  13: done

Labels: ,