DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Checkout A Git Clone Of An SVN Repository In Parent Folder
Here is a quick executable cmd that you run inside a folder checked out with Subversion. It will clone the repository using Git into the parent folder as <projname>.git
Stick this code into ~/bin/gitify and add ~/bin to your path:
#!/usr/bin/env ruby -wKU
# get svn info location
svnurl = `svn info | grep "^URL:"`.gsub('URL: ','').chomp
# project = basename
project = File.basename(Dir.pwd)
puts cmd = "git-svn clone #{svnurl} ../#{project}.git"
`#{cmd}`






Comments
Snippets Manager replied on Wed, 2007/05/16 - 7:54pm
alias testme="ruby -wKUe 'a=%{git-svn};b=%{clone};c=%{`svn info`}.to_s.to_a[1][5..-2];d=%{../}+File.basename(Dir.pwd)+%{.git};system(a,b,c,d);'"Snippets Manager replied on Wed, 2007/05/16 - 7:54pm
Snippets Manager replied on Wed, 2007/05/16 - 7:54pm
ruby -wKUe 'p=%{git-svn clone }+`svn info`.to_a[1][5..-2]+%{ ../}+File.basename(Dir.pwd)+%{.git};`#{c}`;'