Atom want to push with old GitHub credentials


#1

I was successfully working with Atom and GitHub Account #1. Then I have logged out from GitHub in Atom with GitHub:Logout, because I want to start a new project with my second GitHub Account. What I did:

  1. Logout from Github with old account
  2. Clone GitHub repo with Atom
  3. created new GitHub token for new account and login in Atom
  4. changed something in the code from new project
  5. commit with Atom
  6. Push with Atom GitHub
  7. Error unable to push"

error

Looks, that Atom takes the old acount instead of the new account.

  • Atom Version 1.29.0
  • Windows 10

Thx


#2

AFAIK the credentials are stored in the usual locations of git. So atom/git plugin does not handle them. Check on commandline.

https://git-scm.com/docs/gitcredentials


#3

Thx for feedback. But, I have several editors with several Git accounts (Business and Private) and can not change it generally over commandline. It should be (hopefully) configurable in Atom… Or do I understand you wrong?


#4

There should be a .gitconfig file in your user folder. The account name in that file should correspond with the account that Atom is trying to push with, and you should be able to change that to your more recent account.


#6

Thx for that. I know the folder .gitconfig exists, but I could not see it on Windwos although I have enabled to show hidden folders…


#7

Maybe you understand wrong. Just check what I linked. The credentials are per repository. So you won’t mess with any other repo.

And no! It shouldn’t be (seperately) configurable in atom. Because then atom and commandline git might differ about what your credentials are.


#8

I have checked it, but not sure, if I understand everything correct. In addition, I have seen the example on https://git-scm.com/docs/git-credential-store and that is clear to me. However, what do I have to do exactly?

I have tried:

git config credential.<REPO LINK GITHUB.git> NEW USERNAME and then git config credential.helper "$helper $options" --> did not helped, no feedback from Git Bash

Then I have deleted the repo on my local computer, made a new clone of the GitHub repo and the error was:

error

Now I am very confused…Sorry people, I am new to Git.


#9

Seems you didn’t delete the repo on your computer, but removed the directories content - but not completely. You need to trash the hidden files as well. Or better yet: Delete the full directory.


#10

Now, I have deleted everything and restarted Win, then I was able to clone the repo so far so good.

Meanwhile, I have found the .gitconfig file regarding @DamnedScholar advice and indeed the credentials where wrong. I have changed the .gitconfig` file with the correct (new account) name and GitHub e-mail (I have opened with Win TextEditor and changed manually)

Then, I have logged out from Atom GitHub connection and made a new token with my new account on https://github.atom.io/

After try push the same error message appears:
error

Unable to clone --> solved
Unable to push --> still open

It looks, that somewhere the old GitHub account is set… :astonished:


#11

Did you try this?

https://alvinalexander.com/git/git-show-change-username-email-address


#12

The solution was to change the keychain on OS!Delete all the Atom/Github PW in keychain, delete/ re-install everything related to Atom and then connect new to Github with token.