Reputation: 1356
I know, many topics about this on stackoverflow.
But I followed many of these. And nothing helps.
Tried to delete credentials in windows interface, cmdkey /list is empty. Tried to uninstall manager from git. Change user.name and user.email. Tried to restart pc after everything, unset all, delete rsa key... Can't even type all these things.
I don't know what is left that I can do.
But everytime I do git init, in config is
[remote "origin"]
url = [email protected]:ACCOUNT_HERE/REPO_NAME.git
all time old account.
And despite I delete credentials from manager, and even did uninstall, it still has it...
Topic after topic on stack, can't figure it out and nothing helps. Making this topic out of desperation.
So how to change this account or default account on git init or... i don't even know, switch acc, setting default account, default remote origin url's account
Running Win 7 x64.
Upvotes: 0
Views: 1186
Reputation: 2609
Your problem is not with the account that Git is using, but with the upstream URL that Git is using to pull and push from. In Git, this "upstream" is called a remote.
(Assuming you have Git Bash installed)
If you're wanting to change the account that's on the repository, then you should use the git remote
command. For instance, to view the 'origin' upstream remote (Github):
git remote -v
Then to change it:
git remote set-url origin [email protected]:NEW_ACCOUNT/REPO_NAME.git
# to update:
git pull
If you want to, you can just add another remote in case the old repository still exists and you don't want to switch back and forth.
git remote add upstream [email protected]:OLD_ACCOUNT/REPO_NAME.git
# get all the branches that the new remote has
git fetch upstream
# get branch from upstream remote under different branch name
git checkout -b oldmaster --track upstream/master
Read more about remotes in Git and managing your data upstream.
Upvotes: 1
Reputation: 2572
You can change the email that identifies you like discribed in this article:
https://help.github.com/articles/setting-your-commit-email-address-in-git/
Also you will be identified to an account by your ssh key, if using the SSH method (normally to find in Users/USER/.ssh
)
Upvotes: 0