From https://stackoverflow.com/questions/4411457
ssh-keygen -y -f <path to key>
- If there is not a passphrase, it won't ask for one; it will show the public key.
- Otherwise, it will ask for one, and show the public key if you entered it correctly.
ssh-keygen -lf <path to key>
chmod 644 <keyname>.pub
chmod 600 <keyname>
- Make sure the project's remote url has the right protocol (git, not https)
In the project directory (e.g. java-core), edit the .git/config file.
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@github.com:jpsember/java-core.git <------ NOTE THIS LINE!!!!
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Note the format of that url:
url = git@github.com`:<user name>/<repo name>.git
- Make sure the key has been added to apple's keychain or whatever
See: https://stackoverflow.com/questions/21095054/ssh-key-still-asking-for-password-and-passphrase
ssh-add --apple-use-keychain ~/.ssh/<keyname>