After forking and cloning a repository on GitHub, one usually [configures an upstream remote for the fork](https://help.github.com/articles/configuring-a-remote-for-a-fork/):

```
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPO.git

```

Is there a way of finding the upstream URL automatically (programmatically) **without using [hub](https://hub.github.com/)** so I can create an alias (or a script) for the above command?