11

when I am going to push, I got the permission deny

I am going to change GitHub account on TortoiseGit because the current account doesn't have the permission to push.

error:[remote:Permission to (repository) denied to (GitHub account)]

Can any methods change the GitHub account on TortoiseGit?

gp_sflover
  • 3,460
  • 5
  • 38
  • 48
Luke
  • 468
  • 1
  • 5
  • 21
  • Do you just want to add/change your remote you are pushing to? – wilx Apr 26 '16 at 12:56
  • @wilx I want to remove the account: Lgua*** from this laptop and use another one. But I cannot find anywhere I can do that. – Luke Apr 26 '16 at 12:59

2 Answers2

18

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.

There you can see many properties like [core], [remote], [origin].

Now you need to create property like [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.

Mohan
  • 329
  • 4
  • 8
9

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.

Community
  • 1
  • 1
MrTux
  • 32,350
  • 30
  • 109
  • 146
  • 2
    So how do I work with two GIT accounts at once? I need to work with two projects, say personal account and company account. – psycho brm Apr 21 '17 at 08:18
  • @psychobrm With https-URL use the https://username@github.com/ notation with SSH please see https://stackoverflow.com/a/41292048/3906760 – MrTux Apr 21 '17 at 08:39
  • Actually, it seems to work with multiple accounts. The problem was that the other developer gave me GUEST role, so I was unable to clone repository. – psycho brm Apr 21 '17 at 12:58