Skip to content

Instantly share code, notes, and snippets.

@jerodsanto
Last active August 29, 2015 14:07
Show Gist options
  • Save jerodsanto/46fa17b2abedba0678fa to your computer and use it in GitHub Desktop.
Save jerodsanto/46fa17b2abedba0678fa to your computer and use it in GitHub Desktop.
Quick & dirty script to open the current directory's git repo on BitBucket. Surely there's a better way
#!/usr/bin/env ruby
if remote = `git remote -v`.lines.find { |l| l.match /bitbucket/ }
remote.match /(bitbucket\.org\/.*?)\.git/
system "open https://#{$1}"
else
puts "No BitBucket remote :("
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment