2

I am getting an error when trying to push changes to Git repo https://github.com/covid19india/covid19india-react.git

I am using Tortoise Git on Windows 7 and using https. I was able to clone the repo using the same user.

Where might the issue be ?

git.exe push --progress "origin" refactor_switch_route
fatal: HttpRequestException encountered.
An error occurred while sending the request.
remote: Permission to covid19india/covid19india-react.git denied to myusername.
fatal: unable to access 'https://github.com/covid19india/covid19india-react.git/': The requested URL returned error: 403


git did not exit cleanly (exit code 128) (14258 ms @ 17-05-2020 17:37:03)
halfer
  • 19,824
  • 17
  • 99
  • 186
copenndthagen
  • 49,230
  • 102
  • 290
  • 442

3 Answers3

3

It must be that you are forbidden to access that repo or you don't have the required access or authentication. Maybe wrong authentication.

Check this out https://www.a2hosting.in/kb/developer-corner/version-control-systems1/403-forbidden-error-message-when-you-try-to-push-to-a-github-repository

r.purohit
  • 56
  • 4
  • 1
    Awesome..thanks ...that worked...i.e. doing git remote set-url origin "https://username@github.com/username/covid19india-react.git" worked...But still not sure why this was not set automatically when I had cloned the repo....and why I needed to do this explicitly – copenndthagen May 17 '20 at 14:57
  • 1
    Well I also had the same doubt once but you know if you are doing a project in a team and there are many branches of the repo and then you wanna push to a specific repo then this will be really helpful. There are many advantages for this try contributing to a open source repo and you'll learn much more. – r.purohit May 18 '20 at 15:32
  • This worked. I think i used the correct url while cloning but it changed somehow. – Sanjeev Singh Apr 20 '23 at 14:23
0

I had the same issue while trying to push to a specific branch of one of my repositories in which I work solo. I tried doing as suggested but it didn't work... What worked for me was adding the repository to Github Desktop and pushing it from there. I know it is not a solution but it is a workaround.

0

When trying to run $ git push origin main I ran into this problem today and it appears that Github no longer allows you to use your password from terminal. You have to use a Personal Access Token (PAN) or 2 Factor Authentication.

1- Here are some very simple directions with pictures to setup a PAN. If for some reason the link doesn't work you can follow the directions directly from Github.

2- After you create you PAN, if you're using a Mac follow this SO answer to add your PAN to Keychain. It 100% works.

After the above 2 simple steps $ git push origin main works as normal

Lance Samaria
  • 17,576
  • 18
  • 108
  • 256