2

There are two Github repositories for which I have been granted access. Both the repository have different credentials.

Some days back, I accessed repository1 using the first set of username & password. Now I am in need to checkout from second respository, but it is taking the first set of username & password for which the access is NOT granted.

So how do I delete the saved credentials?

Already tried with these links.

  1. remove credentials from git
  2. Remove saved credentials from TortoiseGit

As I am in need of both the repository, hence I don't want the credentials to be saved.

Community
  • 1
  • 1
Kgn-web
  • 7,047
  • 24
  • 95
  • 161

1 Answers1

0

If you use https URLs you can include the username in the URL using the @-notation (https://username@github.com/), then the credentials should be stored for this URL with the username included and not for the whole domain.

or use SSH and PuTTY sessions:

Start PuTTY, fill in the servername (example.com here) in the Host Name-field and put the servername followed by e.g. a number into the Saved Sessions field (e.g. example.com1 or whatever you like). Go to Connection->SSH->Auth and select the key which should be used for this connection. Now go back to Session and hit Save.

Now, when you want to use this saved session use example.com1 as the servername: Clone git@example.com1:/test.git. Plink detects that this is a saved session and loads the correct servername and ssh key from the session.

Based on https://tortoisegit.org/docs/tortoisegit/tgit-ssh-faq.html#tgit-ssh-faq-differentkeys and https://tortoisegit.org/docs/tortoisegit/tgit-ssh-howto.html

Also see:

Community
  • 1
  • 1
MrTux
  • 32,350
  • 30
  • 109
  • 146