I first deleted all credentials related to git in the credential manager in Windows, changed my user.name and user.email to another user in a repo and then push to a remote.