nus-cs2103-AY1819S2 / forum

CS2103/T discussion forum
6 stars 1 forks source link

PUSH-fatal: permission denied + the requested URL returned error 403 #8

Closed JiaruiWang-Jill closed 5 years ago

JiaruiWang-Jill commented 5 years ago

Hi everyone, I am trying topics of week2, PUSH part. I met with one problem shown as below, when clicking PUSH in SourceTree.

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags origin master:master remote: Permission to se-edu/samplerepo-things.git denied to JillWangJill. fatal: unable to access 'https://github.com/se-edu/samplerepo-things.git/': The requested URL returned error: 403 Pushing to https://github.com/se-edu/samplerepo-things.git Completed with errors, see above.

I check git config --list, and user.name & user.email are correct github information.

I tried method here https://stackoverflow.com/questions/15381198/remove-credentials-from-git. Open Credential Manager and delete Generic Credential, but still it shows the failed message.

Any step I missed? Thanks in advance!

JonathanLeeWH commented 5 years ago

@JillWangJill You do not have write permission to https://github.com/se-edu/samplerepo-things.git/ so you cannot push to it. The question and solution are similar to this issue #5. You have to fork https://github.com/se-edu/samplerepo-things.git/ into your own account your repository should be https://github.com/JillWangJill/samplerepo-things.git based on what I check on your Github account. You should be pushing to your forked version https://github.com/JillWangJill/samplerepo-things.git

If you are using sourcetree, please do the following steps:

1) In the current repository tab on your sourcetree, click on the setting icon in the top right hand corner. 2) Under the remote tab, you should see something like: name | path origin | https://github.com/se-edu/samplerepo-things.git/ 3) Select it and click the edit button 4) Change the URL / Path to https://github.com/JillWangJill/samplerepo-things.git (For other users looking at this solution change your url to https://github.com/[your github username]/samplerepo-things.git 5) Click Ok. 6) Click Ok again and try pushing.

I am not sure if it works entirely as I am just writing this based on my brief understanding of sourcetree.

JiaruiWang-Jill commented 5 years ago

Thanks so much for answering this simple mistake. Haha, solved now. I close it.