I am using the following commands to change my user details:
git config --global user.name myusername
git config --global user.email myemail
I pulled a public remote repository from account linked with myusername and when I was trying to push changes it gave the following error:
remote: Permission to myusername/project.git denied to oldusername.
Although I changed it, it still tries to push through the old username only. Why? What am I missing here?
After checking the git config user.name
, I found out that it shows myusername only and not the oldusername!