Skip to content

Instantly share code, notes, and snippets.

@lukemelia
Created June 1, 2010 14:55
Show Gist options
  • Save lukemelia/421027 to your computer and use it in GitHub Desktop.
Save lukemelia/421027 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
url = `git config --get remote.origin.url`.chomp
url.gsub!(%r|git://github.com/(.*\.git)|, 'git@github.com:\1')
if url =~ /^git@github/
puts "git remote rm writeable"
puts `git remote rm writeable`
puts "git remote add writeable #{url}"
puts `git remote add writeable #{url}`
else
raise "only supports github URLs"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment