Unable to git clone after running config modification

时间:2017-12-18 06:05:30

标签: git version-control terminal

When attempting to git clone a forked repository I'm getting the following message

/Users/userName/.ssh/config: line 2: Bad configuration option: st
/Users/userName/.ssh/config: terminating, 1 bad configuration options
fatal: Could not read from remote repository.

I've had no issues using git until I ran this script earlier today from a post I found while trying to clone over public wifi -

https://stackoverflow.com/questions/7953806/github-ssh-via-public-wifi-
port-22-blocked

I'm pretty new to git so, I'm really at a lost of what's happening. I believe I'd must have modified my config file but I'm unsure how to correct it.

1 个答案:

答案 0 :(得分:1)

It’s not necessary to make additional configuration for the SSH key.

If you have made modifications in your SSH key, you can generate a new one to replace the current one:

ssh-keygen

Then press enter to finish the ssh key generate.

Then add the new generated SSH key in github:

Github -> Settings (https://github.com/settings/keys) -> New SSH key -> name a title -> open the file id_rsa.pub and copy the contents of the file as the key in github (as below picture) -> Add SSH key.

enter image description here

Now clone again from github, it should clone successful (if there has config file under .ssh folder, the config file should be deleted).