I know this maybe a dump question but I seem to be unable to push my local commits up to a new accounts repo in github.
Recently, for a school project, I created a secondary account on Github second_username
and forked a school project repo. I worked on it locally in IntelliJ and when I run git push origin master
. It does not ask for my login credentials, which usually happens.
It returns remote: Permission to second_username/ip.git denied to first_username
and fatal: unable to access 'https://github.com/second_username/ip.git/': The requested URL returned error: 403
.
I tried changing the git configurations of both local and global username and email to the second_username
but it keeps saying that I am trying to push as first_username
. I have run through all the settings in git on IntelliJ and it seems correct as my origin remote is set to the correct https url. I suspect it could be due to some login credentials that where unchanged as I always used the first_username
while working on IntelliJ before today.
What I'm doing wrong?