I am trying to push some code to my Github repository. I have a base repository on Github, that I pulled on IntelliJ. After making changes, I am trying to push it back to Github. But, I keep getting the following error : remote: Permission to xxxxxx.git denied to xxxxxx. fatal: unable to access 'https://github.com/xxxxxx/xxxxxx.git/': The requested URL returned error: 403 I am new to both Github and IntelliJ and I have no idea about what I am doing wrong.
I even tried to push the repository from a terminal. But, got the same error
λ git push info: please complete authentication in your browser... remote: Permission to springframeworkguru/spring5webapp.git denied to beingmohitagwl. fatal: unable to access 'https://github.com/springframeworkguru/spring5webapp.git/': The requested URL returned error: 403
Turns out my repository was forked from someone else's repo. So, I had to change the owner of my repo to allow git push.
Initially :
λ git remote -v origin https://github.com/notMyRepo/app.git (fetch) origin https://github.com/notMyRepo/app.git (push)
I changed it by : λ git remote set-url origin https://github.com/myRepo/app