Migrating the WinSwitch repository from Subversion to GitEdit
Local import
$ cat ~/.svn-authors
wincent = Greg Hurrell <greg@hurrell.net>
$ git svn clone --stdlayout -A ~/.svn-authors svn+ssh://svn.example.com/WinSwitch src
Remote configuration
$ cd /pub/git/path_to_public_repos
$ sudo -u git mkdir WinSwitch.git
$ cd WinSwitch.git
$ sudo -H -u git git --bare init
$ sudo -u git touch git-daemon-export-ok
$ echo "Fast User Switching menu replacement for Mac OS X" | sudo -u git tee description
$ echo "WinSwitch.git example@example.com" | sudo -u git tee -a /pub/git/conf/gitweb-projects
Initial push
$ git tag -s r77 # tag initial Subversion import, corresponding to revision 77
$ git remote add origin git.wincent.dev:/pub/git/path_to_public_repos/WinSwitch.git
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master
$ git push --all
$ git push --tags
Access
$ cat ~/.svn-authors
wincent = Greg Hurrell <greg@hurrell.net>
$ git svn clone --stdlayout -A ~/.svn-authors svn+ssh://svn.example.com/WinSwitch src
$ cd /pub/git/path_to_public_repos
$ sudo -u git mkdir WinSwitch.git
$ cd WinSwitch.git
$ sudo -H -u git git --bare init
$ sudo -u git touch git-daemon-export-ok
$ echo "Fast User Switching menu replacement for Mac OS X" | sudo -u git tee description
$ echo "WinSwitch.git example@example.com" | sudo -u git tee -a /pub/git/conf/gitweb-projects
Initial push
$ git tag -s r77 # tag initial Subversion import, corresponding to revision 77
$ git remote add origin git.wincent.dev:/pub/git/path_to_public_repos/WinSwitch.git
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master
$ git push --all
$ git push --tags
Access
$ git tag -s r77 # tag initial Subversion import, corresponding to revision 77
$ git remote add origin git.wincent.dev:/pub/git/path_to_public_repos/WinSwitch.git
$ git config branch.master.remote origin
$ git config branch.master.merge refs/heads/master
$ git push --all
$ git push --tags
You can now create a clone of the repo using:
$ git clone git://git.wincent.dev/WinSwitch.git
Local cleanup
Seeing as I have no intention of ever committing to the old Subversion repo again, I remove the corresponding configuration to make sure that I never accidentally commit to the old repo:
$ git config --remove-section svn-remote.svn