How do I verify that a specific public key file is used with git?

I sent a 3rd party my public SSH key, which they used to add access for me to a particular repository. However, when I try to git clone, I get errors (in fact, I’m asked for a password).

I’ve run into issues before when what I thought was my public key, wasn’t in fact the public key used by my git client. My question:

  • Git - rollback to a previous commit
  • Is there a way to integrate git into the windows cmd or powershell?
  • Git workflow for small web team
  • What should I do when git revert aborts with an error message?
  • .gitignore a folder content
  • Cannot trigger post-commit git hook on git submodule
  • How do I verify which SSH key my git client uses?

    >ssh git@git.wpengine.com info
    git@git.wpengine.com's password:     <--- this shouldn't happen
    

  • git svn rebase always conflicts with my own commits
  • Line endings with cygwin and Github for Windows
  • How stable is the git plugin for eclipse?
  • Setting up a complex git alias
  • Close Jira issue via Git commit
  • Locking a branch, so that it cannot be staged/committed into? (Only merged/etc)
  • One Solution collect form web for “How do I verify that a specific public key file is used with git?”

    You can use an ~/.ssh/config file in order to specify the exact hostname, user and private key you want to use:

    Host wpengine 
    user git
    hostname git.wpengine.com
    IdentityFile ~/.ssh/myPrivateKey
    

    That way, there is no ambiguity as to which key is used.

    ssh -vvvT wpengine
    

    That command will tell you what is happening.
    Usually, the public key is incorrectly added to the ~/.ssh/authorized_keys in the server side.

    Git Baby is a git and github fan, let's start git clone.