git 如何在 TortoiseGit 上更改 GitHub 帐户
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36865486/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change GitHub account on TortoiseGit
提问by Luke
I am going to change GitHub account on TortoiseGit because the current account doesn't have the permission to push.
我要在 TortoiseGit 上更改 GitHub 帐户,因为当前帐户没有推送权限。
error:[remote:Permission to (repository) denied to (GitHub account)]
错误:[远程:对(存储库)的权限被拒绝(GitHub 帐户)]
Can any methods change the GitHub account on TortoiseGit?
有什么方法可以更改 TortoiseGit 上的 GitHub 帐户吗?
采纳答案by MrTux
I suppose you enabled a git credential helper and stored the credentials. You have to delete them manually using the windows credential manager, see https://stackoverflow.com/a/31782500/3906760. After that you will be asked again and can use a different account.
我想你启用了一个 git 凭据助手并存储了凭据。您必须使用 Windows 凭据管理器手动删除它们,请参阅https://stackoverflow.com/a/31782500/3906760。之后,系统会再次询问您并可以使用其他帐户。
回答by Mohan
I know it is late but some may find the below information useful.
我知道现在已经晚了,但有些人可能会发现以下信息很有用。
You need to open the .git folder (it is hidden folder, enable show hidden folders option first) then config file within it.
您需要打开 .git 文件夹(它是隐藏文件夹,首先启用显示隐藏文件夹选项)然后在其中打开配置文件。
There you can see many properties like [core], [remote], [origin].
在那里您可以看到许多属性,例如 [core]、[remote]、[origin]。
Now you need to create property like [credential].
现在您需要创建像 [credential] 这样的属性。
[credential]
username = your-account-username
[user]
name = your name
email = your email address
if any of the property is already present, replace it with your required account detail.
如果任何财产已经存在,请将其替换为您所需的帐户详细信息。
That's it, now when you commit or push again, it will ask for the password of the account details you have entered in config file.
就是这样,现在当您再次提交或推送时,它会询问您在配置文件中输入的帐户详细信息的密码。