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