Search code examples
gitpush

403 Error while pushing to a public repository which is NOT owned by me? How to overcome this?


I have cloned a public repository which is not owned by me. I made changes to that repository. Now after committing the changes , when i am trying to push i am getting this error--

$ git push origin master
remote: Permission to navindian/******.git denied to Arpan619Banerjee.
fatal: unable to access '<github URL of that repo>': The requested URL returned error: 403

Pls tell me how can I push the changes. I have taken the userid and password from the owner of the repository.


Solution

  • You can not push to a public repository. You have to be added as a contributor by the owner of the repo.

    But you can do code changes in that repo through merge requests via a fork.

    If you are on GitHub:

    1. Fork the repository
    2. Clone the forked repo
    3. make the changes and commit it to the forked repo
    4. raise a merge request to the original repo.

    Once the merge request is reviewed, it should be merged.