0

I set up my project using the following credentials

git config --global user.email poddar.kumar.himanshu@gmail.com
git config --global user.name poddarhimanshu
git config --global user.password XXXXXXXX

But since I was working on multiple projects which were related to my multiple account I changed the credentials to point to my other github account which worked successfully. But now when I changed the credentials again to my first github account and execute the same steps as above.

So when I am executing the commands to upload my project :

git remote add origin https://github.com/poddarhimanshu/recipe-app-api.git
git push origin master

I am getting an error

remote: Permission to poddarhimanshu/recipe-app-api.git denied to masterhimanshupoddar.
fatal: unable to access 'https://github.com/poddarhimanshu/recipe-app-api.git/': The requested URL returned error: 403

Note that in remote error its still pointing to the other account which I set up. The poddarhimanshu and masterhimanshupoddar are two different accounts. poddarhimanshu is the one where I want to upload currently after reconfiguring the email and password.

Himanshu Poddar
  • 3,438
  • 5
  • 34
  • 67
  • Use git config without global flag to set the account you want for desired projects. – rivamarco Dec 23 '19 at 14:18
  • does not work still getting error `remote: Permission to poddarhimanshu/recipe-app-api.git denied to masterhimanshupoddar. fatal: unable to access 'https://github.com/poddarhimanshu/recipe-app-api.git/': The requested URL returned error: 403 ` – Himanshu Poddar Dec 23 '19 at 14:20
  • Does this answer your question? [fatal: could not read Username for 'https://github.com': No such file or directory](https://stackoverflow.com/questions/22147574/fatal-could-not-read-username-for-https-github-com-no-such-file-or-directo) – phd Dec 23 '19 at 16:22
  • `user.email`/`user.name` have nothing to do with authentication, and `user.password` is an error, it's not used by `git` at all. Either you need SSH keys and SSH URL, or you need to put username (and probably password) into HTTP(S) URL. – phd Dec 23 '19 at 16:24

0 Answers0