Search code examples
githubforkclone

Forking vs Cloning in GitHub


I have a GitHub account and my friend invites me as a collaborator to his project. And now I want to rub the code base locally in my personal computer.

Help me with following;

  • Do I need to clone his repo into my personal computer and do changes and then commit.

or

  • Do I need to fork the repo, then clone the forked one into my personal computer, do changes and the create a pull request.

I am having doubts about both above methods. Can you help me with that? I want the similarities and differences of each approach.

I tried directly clone from my friend's repo. But after I do that the repo doesn't display on my GitHub profile. Since we do this project as a hobby project, and I need to add this to my portfolio, I would be better if it displays on my GitHub profile.


Solution

  • Forking will create copy of that repo under your own GitHub profile. Than you will be making changes in your own repository copy, testing everything and finally opening Pull Request to original repository

    Seems like that's what you want.