0

How do I see which ssh key i’m using when pulling with git pull?

I can see how to specify a key with ~/.ssh/config (https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use ) but it would be great to get some output that says exactly which key I'm using.

1 Answer 1

1

You can specify verbosity level to ssh by passing it in the GIT_SSH_COMMAND environment variable:

GIT_SSH_COMMAND="ssh -vvv" git pull

That will probably give you more info that you want.

Filter to taste:

GIT_SSH_COMMAND="ssh -v" git pull 2>&1 | awk -F\: '/Offering.*key/ { print $3 }'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.