infer-upstream: Find the repository from where a given repo was forked

[ development, mit, program ] [ Propose Tags ]

Find the repository from where a given repo was forked

[Skip to Readme]
Versions [RSS] [faq],
Dependencies base (>=4.0 && <5.0), github (>=0.8), optparse-applicative (==0.5.*), text (>=0.10 && <0.12) [details]
License MIT
Author Noon Silk
Category Development
Home page
Uploaded by NoonSilk at 2014-06-27T03:37:11Z
Distributions NixOS:
Executables infer-upstream
Downloads 1574 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
Successful builds reported [all 7 reports]


Maintainer's Corner

For package maintainers and hackage trustees


Readme for infer-upstream-

[back to package description]


Takes a repo name, and looks up the upstream repository. If there is an upstream repository, writes it to standard out. Otherwise writes nothing.


noon@dev> infer-upstream -r scirate3 -u silky

Another usage:

cd scirate3
git remote add upstream `infer-upstream -r scirate3 -u silky`

A more interesting usage (and the reason I wrote this) is to use the script. It performs the following task.

For all folders in a given directory:

  • go into each one,
  • if it is a github repo,
  • look up the upstream repo,
  • if we find it,
  • set it as a new remote.


noon@~> cd dev
noon@dev> git clone
noon@dev> infer-upstream/

With upstream set on your repos, you can then run, if you like, which will bring down any incoming changes and give print out a short summary.


fetching upstream for Javascript-Voronoi ...
 1 file changed, 2 insertions(+), 2 deletions(-)


  • This script assumes every folder in the ~/dev directory is the clone of a Github repository.
  • Github currently limits you to 60 unauthenticated API requests per hour; this approach uses one API request per folder.