Skip to content

Instantly share code, notes, and snippets.

@devigned
Created October 3, 2015 07:06
Show Gist options
  • Save devigned/265a2d0a15e42ac2f841 to your computer and use it in GitHub Desktop.
Save devigned/265a2d0a15e42ac2f841 to your computer and use it in GitHub Desktop.
A little PowerShell script to jump to a github repo given the remote name
function GitHub {
Param
(
[CmdletBinding()]
[parameter(Mandatory=$true)]
[String]
$remote
)
$loc = (git remote show $remote | Select-String -Pattern "Fetch URL: (.+?)github.com[:|/](?<fork>.*)\.git" | select -expand Matches | foreach { $_.groups["fork"].value })
Start "http://github.com/$loc"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment