0

I am facing issues with the git credential manager.

I have 2 accounts, and I have specific repositories that use a specific account. Until now, I logged-out and logged-in everytime at VSC, till I heard today that there is a credential manager to do this for you. In the start, it worked perfectly, for the 2 test commits I did, one from each account. I now did another commit, but, git used the other account (from now on called a). A, doesn't have access to the repo I was commiting, but git still commited without any errors being present. I tried to rm -rf .git and re-add the links (I use https://username@github.com/user/repo syntax), but still, it pushes with A. I don't have any problem resetting the repo, as it is a new one, with one coommit. I tried to also un-install and re-install the manager. Then, I followed instructions on here, and also created 2 tokens, one for each account. Resseted the repo and re-tried. Github asked for login, I supplied the token of the 2nd account, and still, it pushed with the first. I suspect it is because of the config, because its user.email and user.name values are of A.

  • Did you run Step 4 `git config --global credential.https://github.com.useHttpPath true` in the instructions? If you did, you don't need to use `https://username@github.com/user/repo`. Use `https://github.com/user/repo` instead. – ElpieKay Jul 03 '23 at 14:39
  • @ElpieKay I did step 4 and I tried your method, still same problem – Thanasis Lanaras Jul 03 '23 at 14:42
  • Remove the cached username and token in the manager and then try `git fetch $remote1` and `git fetch $remote2` to input the username and token for the two repository urls. – ElpieKay Jul 04 '23 at 01:44

0 Answers0