This needs to work with remotes like `https://github.com/cowboy/dotfiles` and `https://github.com/cowboy/dotfiles.git`. How about this?

```bash
repo="$(git remote show -n origin | perl -ne '/Fetch URL: .*github\.com[:\/](.*\/.*?)(?:\.git|$)/ && print $1')"
```