9

Why, under Settings => SSH keys, on my GitHub account does it say;

Added on Oct 24, 2014 by GitHub for Mac — Never used

Never used? I've used it! I've got plenty of contributions showing up on my profile. From that machine!

I have another key that says, quite rightly;

Last used within the last day.

...That one is from a different machine.

mikelovelyuk
  • 4,042
  • 9
  • 49
  • 95
  • This is very sensitive to your working environment. Do you have multiple keys? Do you use some kind of ssh-agent? Do you use some kind of ssh-agent-forwarding? Have you tried getting SSH to be verbose when communicating with github? – starlocke Nov 23 '15 at 21:52

1 Answers1

14

Your contributions may be from that machine, but you need to check how you have set up your remotes

try the following command:

git remote -v

That will list your remotes

If it is something like

origin https://github.com/......

You are connecting over https, and not SSH

You'll need to remove that remote -

git remote rm origin

Then, on your github repository page, see the following:

enter image description here

Click the SSH link, and copy that. It should start with git@github.com

Then, add that as the remote-

git remote add origin git@github.com:.... etc

Alex
  • 37,502
  • 51
  • 204
  • 332
  • After I tried those commands, I got essentially the same problem as this guy http://stackoverflow.com/questions/12940626/github-error-message-permission-denied-publickey. I followed the suggested guide in one of the answers (https://help.github.com/articles/generating-ssh-keys/) and now it all seems to be working. So thank you! – mikelovelyuk Nov 23 '15 at 22:18
  • interesting on that rm vs remove command though. The git prompt suggested `add`, `rename`, `remove`, `set-head` etc. So I just had a punt on `remove` – mikelovelyuk Nov 23 '15 at 22:23
  • 1
    Instead of removing remote, use `set-url` instead. https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories#changing-a-remote-repositorys-url – Wtower Jan 02 '22 at 18:05