Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github account authenticated with token in intellij

I recently started working in a new development team. Since I didn't have access to repos, but we wanted to clone them already, the coworker granted me his access with username and github token, without password, I believe. After I was granted access to company github, I wanted to use my personal token. When I type my token in Intellij IDEA Github settings and click "Test", it says "Connection successful for user ", but when I try to interact with git, it says, that Authentication failed. Coworker's tokens still work, but I can't figure out why. It looks like I'm still logged in with his account somehow, but can't find where.

like image 902
veit270 Avatar asked Oct 17 '22 14:10

veit270


1 Answers

UPD. Since 2019.1, IntelliJ overrides git credential helper by default (with git 2.9 and above). Check if Use credential helper is enabled in Settings | Version Control | Git, and disabled if needed.

Old reply:

IDEA uses command-line git. The git client can save credentials used on its own if the credential helper is configured. Most likely it saved the previous token and now automatically uses it.

Please make sure the git config credential.helper executed in the project directory returns nothing. Alternatively, using the same command find out what helper is in use, and delete the saved token from there.

like image 50
Dmitriy Smirnov Avatar answered Oct 21 '22 06:10

Dmitriy Smirnov