mkozicki
mkozicki

Reputation: 6892

How to determine the user that forked a repo into my organization?

I am trying to determine who created a fork from a repo in another github organization. For example, in the organization https://github.com/companyA, someone created a fork from the https://github.com/companyB/instructions repo as https://github.com/companyA/instructions. How can I view the initiator?

I have looked through the Settings and Insights sections of my github organization in the fork from the other organization. I am unable to find who created the fork. I've looked in history and did not find the creator. I've searched for "how to determine who forked a repo into my organization in github" and with similar wording but have been unable to find the information. The results mostly point to "who forked my repo, not who forked their repo along with forks and how to manage them.

Upvotes: 6

Views: 695

Answers (3)

lobner
lobner

Reputation: 593

If no commits has been made to the repo, visit https://github.com/<org>/<repo>/branches and identify the latest updater of the default branch. This is the initiator (mother forker)

person who forked the repo

Upvotes: 0

Dylan Cali
Dylan Cali

Reputation: 1479

Go to Settings -> Collaborators and Teams and under Access the user who is explicitly listed as Admin is the likely forker (esp if only one)

Upvotes: 0

VonC
VonC

Reputation: 1328122

I do not believe there is a direct way to determine who forked a repo into your organization in GitHub.

I have looked through the Settings and Insights sections of my GitHub organization in the fork from the other organization. I am unable to find who created the fork. I've looked in history and did not find the creator

That means the fork has been created, but no commit has ever been done.

Check if listing fork is enough.
I use the GitHub CLI gh api

C:\Users\vonc>gh api -H "Accept: application/vnd.github+json" /repos/VonC/batcolors/forks --jq "sort_by(.created_at) | .[] | {login: .owner.login, created_at: .created_at}"
{"created_at":"2020-01-23T12:25:04Z","login":"jeb-de"}
{"created_at":"2022-01-29T14:25:31Z","login":"canarddu38"}

That should work for their (public) repositories, not just yours.

Upvotes: 2

Related Questions