Skip to content

Instantly share code, notes, and snippets.

@eric1234
Created September 14, 2009 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eric1234/186832 to your computer and use it in GitHub Desktop.
Save eric1234/186832 to your computer and use it in GitHub Desktop.
Will list all forks related to a project on GitHub.
#!/usr/bin/env ruby
# Provides a way to list forks on github for a project.
#
# git-hub-fork-network user project
require 'rubygems'
require 'octopi'
module Octopi
class Repository < Base
# Will return all forks for the current repository
def all_forks
resources = api.get '/repos/show/:user/:repo/network',
{:user => self.owner, :repo => self.name}
resources['network'].map { |item| self.class.new(api, item) }
end
end
end
repo = Octopi::Repository.find *ARGV
repo.all_forks.each do |fork|
puts fork.clone_url
end
@johnjohndoe
Copy link

@eric1234 Your script is no longer working. Would be cool if you can fix it.

@bityob
Copy link

bityob commented Jun 12, 2017

http://forked.yannick.io/ - A web app to list all forks, very useful.

This is the source code: https://github.com/ys/forked

@JimnyGitHub
Copy link

http://forked.yannick.io/ - A web app to list all forks, very useful.

This is the source code: https://github.com/ys/forked

error 404, page not found

it's a pity, the project no longer exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment