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?
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.
If you fork a repo. it clones (makes a copy of) the repo into your account, with all the commits. You own the fork, but not the original. It won't have any of the stars, dependents, followers, or Issues from the original. But since contributor info is based on the commits, that part will look the same, to the degree you keep them in sync.
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:
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.
If you seek recognition as one of the creators, this is not the option for you.
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:
But since anyone can pin or fork a repo, no one will know that you are one of the creators or maintainers with either of these choices, not unless the README makes that clear.
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.