1

I am having a problem, I can't push using git using my own email address, so the story is that there was a team, the team has developers and the number of devs is six, the seventh was me, I had to log in with an other person account ( in azure repo ), before my account is created.

I was working with that account, and then switched to mine when created, and changed my email and name using git config -g user.email and username too but I am still pushing with the old account.

I have faced this problem before, what did I do to resolve it ? I deleted my github credentials from my computer and probleme is solved, but I was using github not azure, when I go Now to the Windows -> Control Panel -> Windows Credentials I don't find any git credentials or anything to remove them and solve the problem, I got log out from the old account of that person, so how could I fix the problem.

=========== Edit ===========

I found out that I was using a key everytime I push or pull, that key was given to me by the person I was using his account.

I know now that I have to use my own key, and to be honnest I don't know what are ssh keys, I just hear of them.

I tried to generate a new one but I got an error :

enter image description here

This the error I got :

enter image description here

The key I used is thje server SHA256 FINGERPRINT :

enter image description here

I have used it, because I thought this the one, but no, it is not.

What should I use ?

I followed steps here But I am not using it correcly because I don't know what are ssh keys.

Any help would be much appreciated.

TaouBen
  • 1,165
  • 1
  • 15
  • 41
  • 1
    Do not confuse the email address that you use to identify yourself to Azure or Github (your _username_) with the email address that is used inside a commit to say who made the commit (git's `user.email`). They are unrelated. – matt Jun 10 '20 at 17:36
  • 1
    Haven't worked with azure but this is what I know using git and GitHub. If you were using https creds to access repo and your git config was to store credentials check if there is a file in linux it is something like this ~/.git-credentials. If you are using ssh check your ssh keys – Shubham Srivastava Jun 10 '20 at 17:40
  • 1
    This should help https://stackoverflow.com/a/46337214/11983771 – doublezofficial Jun 10 '20 at 18:14

1 Answers1

1

Check first the URL used for pushing:

git remote -v

If it is SSH, no amount of Widows credentials manager fiddling would help, since it is used for HTTPS credentials (username/password) caching.

An SSH URL would mean you are using the SSH key of another GitHub account.

To generate your own key, follow "Generating a new SSH key ". I would recommend first to not add a passphrase (no need for an ssh agent then), for testing.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Yes, I am doing this, How can I generate my own key – TaouBen Jun 11 '20 at 08:00
  • @TaouBen I have edited the answer to address your comment. – VonC Jun 11 '20 at 08:10
  • I think I can add it without command lines, I have a page in azure repo where I can add it, but clearly I am not giving a valid key, I will edit my answer to show you – TaouBen Jun 11 '20 at 08:28
  • @TaouBen You need to generate the key with `ssh-keygen -t rsa -m PEM -P "" -f azure`, and copy the content of `azure.pub` – VonC Jun 11 '20 at 08:57