简体   繁体   中英

Remote permission denied in github while trying to push to origin

I have started to contribute to a public repository on GitHub, but after I have created a pull request it says remote: Permission when I am trying to push another code to my origin.

remote: Permission to una/CSSgram.git denied to Pradhvan.
fatal: unable to access ' https://github.com/una/CSSgram.git/ ': The requested URL returned error: 403

Anyone else having the same problem. The issue would be you had cloned the repo from Github of the owner(here Una's repo) and you are pushing that change directly to the repo. This is the not right way as you don't have permission to push changes to that repo.

The right step would be:

  1. Fork the original repo so you get a copy of it. Url of your forked repo would be something like https://github.com/<your Github username>/<repo_name>

  2. Clone the repo that you just forked.

  3. Create a branch ( git checkout -b "MyPatch1" ) and now make the changes to the code.

  4. Push the changes to your fork ( git push origin MyPatch1 )

  5. Open Github and go to the owner's repo and you would see a button appear Click the Compare & pull request button .

Congratulation! You have successfully created a pull request.

PS: The funny thing is this question just showed up after 4 years. xp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM