Whenever I try to push my code to its repository, I get the following error:
remote: Permission to Sam-Olendi/dentioapp.git denied to samolendi.
fatal: unable to access 'https://github.com/Sam-Olendi/dentioapp.git/': The requested URL returned error: 403
git config --global user.name "Sam-Olendi"
git config --global user.email "firstname.lastname@example.org"
git commit --author="Sam-Olendi <email@example.com>"
git commit --amend --author="Sam-Olendi <firstname.lastname@example.org>"
git config -e
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
url = https://github.com/Sam-Olendi/dentioapp.git
fetch = +refs/heads/*:refs/remotes/origin/*
remote = origin
merge = refs/heads/master
url = https://git.heroku.com/dentioapp.git
fetch = +refs/heads/*:refs/remotes/heroku/*
wmstate = normal
geometry = 887x427+52+52 171 192
I think the key here is that you used HTTPS to clone the new repository AND I am assuming (until you respond to my comment) that you are using Windows which makes the following even more relevant. I suspect that your credentials are being cached by the credentials helper.
On windows, if you've used the wincred helper (
git config --global credential.helper wincred), then this stores your credentials in the Windows credential store which has a Control Panel interface where you can delete or edit your stored credentials. See this for instance:
With this store, your details are secured by your Windows login and can persist over multiple sessions. This was added in Git for Windows 184.108.40.206.
Try clearing the credential cache for your https cloned repo using the following and try again:
git credential-osxkeychain erase host=github.com protocol=https