Search code examples
gitgithubopen-source

Display a repository of which I am collaborator on profile


My friend and I are working on a project we designed together. My friend created a repository for the project and I am a collaborator so I can easily add changes. But is there a way to display this repo on my profile?


Solution

  • A repo will only show up under the user or org that "owns" it. Here are three options for you. If you both own the work, you should probably go with option 3.

    option 1: fork a copy to your profile

    But what you can do is fork it. It essentially clones the repo into your account, with all the commits. Since contributor info is based on the commits, it will show the same contributor information.

    Since you were added as a collaborator, you have direct access to the original repo and can push commits to it directly. You can keep your clone in sync with the original with the recently aded fetch upstream button:

    enter image description here

    This means you do not need to do steps 2-5 of Henrique's answer. Not unless you prefer pushing your changes to your fork first, and then doing pull requests from it to your friend's.

    option 2: pin the repo owned by your friend to your profile

    Another thing you can do is to pin a repo so that it appears on the top of your profile. You can pin either the original or your fork:

    enter image description here

    option 3: create an org to reflect shared ownership

    If the repo shouldn't belong to one person, create an org and move the repo to the org, and make both of you admins of the org.